static void TestSuite_Struct <T, F>(FieldInfo field, F testValue, Dictionary <string, ReusableConstraint> expectedCaseToConstraint) where T : struct
        {
            TestTools.AssertImmediate(() => Assert.NotNull(field));
            var availableTestCases = Merge(
                AvailableTestCases_StructFieldRefAccess <T, F>(field, field.Name)
                );

            new ATestSuite <T, F>(typeof(T), field, testValue, expectedCaseToConstraint, availableTestCases).Run();
        }
Exemplo n.º 2
0
 public ATestSuite(Type instanceType, FieldInfo field, F testValue,
                   Dictionary <string, ReusableConstraint> expectedCaseToConstraint,
                   Dictionary <string, IATestCase <T, F> > availableTestCases)
 {
     TestTools.AssertImmediate(() =>
     {
         Assert.That(expectedCaseToConstraint.Keys, Is.EquivalentTo(availableTestCases.Keys),
                     "expectedCaseToConstraint and availableTestCases must have same test cases");
         Assert.That(instancePrototypes, Contains.Key(instanceType));
         Assert.IsTrue(typeof(T).IsAssignableFrom(instanceType), "{0} must be assignable from {1}", typeof(T), instanceType);
     });
     this.instanceType             = instanceType;
     this.field                    = field;
     this.testValue                = testValue;
     this.expectedCaseToConstraint = expectedCaseToConstraint;
     this.availableTestCases       = availableTestCases;
 }