diff --git a/Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs b/Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs new file mode 100644 index 0000000..ee35135 --- /dev/null +++ b/Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs @@ -0,0 +1,8 @@ +namespace System.Diagnostics.CodeAnalysis +{ + /// Specifies that the attributed code should be excluded from code coverage information. + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, AllowMultiple = false, Inherited = false)] + public sealed class ExcludeFromCodeCoverageAttribute : Attribute + { + } +} diff --git a/Synergy.Contracts/Extensions/TypeExtensions.cs b/Synergy.Contracts/Extensions/TypeExtensions.cs new file mode 100644 index 0000000..73dce72 --- /dev/null +++ b/Synergy.Contracts/Extensions/TypeExtensions.cs @@ -0,0 +1,13 @@ +using System; +using System.Reflection; + +namespace Synergy.Contracts.Extensions +{ + internal static class TypeExtensions + { + public static bool IsInstanceOfType(this Type type, object obj) + { + return obj != null && type.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo()); + } + } +} \ No newline at end of file diff --git a/Synergy.Contracts/Failures/DesignByContractViolationException.cs b/Synergy.Contracts/Failures/DesignByContractViolationException.cs index 6e6ef8a..8ca3c79 100644 --- a/Synergy.Contracts/Failures/DesignByContractViolationException.cs +++ b/Synergy.Contracts/Failures/DesignByContractViolationException.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics; -using System.Runtime.Serialization; using JetBrains.Annotations; namespace Synergy.Contracts @@ -9,7 +8,6 @@ namespace Synergy.Contracts /// The exception thrown when some contract check failed. /// When you see it it means that someone does not meet the contract. /// - [Serializable] [DebuggerStepThrough] public class DesignByContractViolationException : Exception { @@ -27,13 +25,5 @@ public DesignByContractViolationException() public DesignByContractViolationException([NotNull] string message) : base(message) { } - - /// - /// Serialization required constructor. - /// - protected DesignByContractViolationException([NotNull] SerializationInfo info, StreamingContext context) : - base(info, context) - { - } } } \ No newline at end of file diff --git a/Synergy.Contracts/Failures/FailCastable.cs b/Synergy.Contracts/Failures/FailCastable.cs index 902363b..b37a553 100644 --- a/Synergy.Contracts/Failures/FailCastable.cs +++ b/Synergy.Contracts/Failures/FailCastable.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; using JetBrains.Annotations; +using Synergy.Contracts.Extensions; namespace Synergy.Contracts { diff --git a/Synergy.Contracts/Synergy.Contracts.csproj b/Synergy.Contracts/Synergy.Contracts.csproj index bc2932b..b3eca28 100644 --- a/Synergy.Contracts/Synergy.Contracts.csproj +++ b/Synergy.Contracts/Synergy.Contracts.csproj @@ -1,16 +1,9 @@ - - - + - Debug - AnyCPU - {653FF172-0DC5-4D81-91AE-3CE09D8CF7C1} - Library - Properties - Synergy.Contracts + netstandard1.0 Synergy.Contracts - v4.5.2 - 512 + Synergy.Contracts + false true @@ -35,42 +28,7 @@ true - - ..\packages\JetBrains.Annotations.10.2.1\lib\net\JetBrains.Annotations.dll - True - - - - - - - Properties\SynergyAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - + + - - \ No newline at end of file diff --git a/Synergy.Contracts/packages.config b/Synergy.Contracts/packages.config deleted file mode 100644 index b26fcb6..0000000 --- a/Synergy.Contracts/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file