Exemplo n.º 1
0
        public InstanceRefTester()
        {
            instance   = new NullInstance();
            familyMock = new Mock <IFamily>();

            instanceRef = new InstanceRef(instance, familyMock.Object);
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            instance = new NullInstance();
            family   = MockRepository.GenerateMock <IFamily>();

            instanceRef = new InstanceRef(instance, family);
        }
        public InstanceRefTester()
        {
            instance   = new NullInstance();
            familyMock = Substitute.For <IFamily>();

            instanceRef = new InstanceRef(instance, familyMock);
        }
Exemplo n.º 4
0
        public virtual void Verify_Base_Enumeration_Names(string name, string displayName)
        {
            var value = NullInstance.GetValueByName(name.AssertNotNull().AssertNotEmpty());
            var other = NullInstance.GetValueByDisplayName(displayName.AssertNotNull().AssertNotEmpty());

            other.AssertSame(value);
            Reporter.Report(value.Name);
        }
Exemplo n.º 5
0
 /// <summary>
 /// By definition, Enumerations are not to have Public Constructors.
 /// </summary>
 /// <see cref="NullInstance"/>
 /// <see cref="EnumerationTestCaseExtensionMethods.ShallNotHaveAnyPublicCtors{T}"/>
 public virtual void Shall_Not_Have_Any_Public_Ctors() => NullInstance.ShallNotHaveAnyPublicCtors(Reporter);
 public void Does_Have_One_Public_Ctor() => GetSingle <Action>(() => NullInstance.ShallNotHaveAnyPublicCtors()).AssertThrows <EmptyException>();
 public void Does_Not_Have_Any_Values() => GetSingle <Action>(() => NullInstance.ShallHaveAtLeastOneValue()).AssertThrows <NotEmptyException>();
 public void Does_Not_Have_Expected_Ctors() => GetSingle <Action>(() => NullInstance.HasExpectedCtors(CtorInspectors.ToArray())).AssertThrows <NotEmptyException>();
 public void Expecting_at_least_One_value() => GetSingle <Action>(() => NullInstance.ShallAllHaveConsistentBitLengths()).AssertThrows <NotEmptyException>();
 public void Expecting_All_Values_Not_Null() => GetSingle <Action>(() => NullInstance.ShallAllHaveConsistentBitLengths(false)).AssertThrows <NotNullException>();
 public void There_Are_No_Expected_Ctors() => GetSingle <Action>(() => NullInstance.HasExpectedFlagsCtors()).AssertThrows <NotNullException>();
Exemplo n.º 12
0
 public static TermSumNode GetNullInstance()
 {
     return(NullInstance.GetInstance());
 }
 public virtual void Keys_Shall_Be_Uniquely_Assigned() => NullInstance.KeysShallBeUniquelyAssigned <TKey, T>(Reporter, OutputHelper);
Exemplo n.º 14
0
 public virtual void Has_Expected_Flags_Ctors() => NullInstance.HasExpectedFlagsCtors(Reporter);
Exemplo n.º 15
0
 public virtual void Has_Expected_Ctors()
 {
     NullInstance.HasExpectedCtors(CtorInspectors.ToArray());
     Reporter.Report(Enumeration.GetValues <T>().Select(x => x.Name).ToArray());
 }
Exemplo n.º 16
0
 public void Shall_Have_At_Least_One_Value() => NullInstance.ShallHaveAtLeastOneValue(Reporter);
 public void Expecting_Consistent_Bit_Lengths() => GetSingle <Action>(() => NullInstance.ShallAllHaveConsistentBitLengths()).AssertThrows <EqualException>();
 public void Expecting_Uniquely_Assigned_Value_Keys() => GetSingle <Action>(() => NullInstance.KeysShallBeUniquelyAssigned()).AssertThrows <EqualException>();
 public void Expected_Ctor_Is_Not_Private() => GetSingle <Action>(() => NullInstance.HasExpectedFlagsCtors()).AssertThrows <TrueException>();