public IEnumerable <EqualityTestCase> For(Type type)
        {
            var tracker = new ConstructorArgumentsTracker(specimenBuilder, type.GetConstructors().Single());

            var instance        = tracker.CreateNewInstance();
            var anotherInstance = tracker.CreateNewInstanceWithTheSameCtorArgsAsIn(instance);

            yield return(new EqualityTestCase(instance, anotherInstance, true));

            foreach (var distinctInstance in tracker.CreateDistinctInstancesByChaningOneByOneCtorArgIn(instance))
            {
                yield return(new EqualityTestCase(instance, distinctInstance, false));
            }
        }
Ejemplo n.º 2
0
        public IEnumerable<EqualityTestCase> For(Type type)
        {
            var tracker = new ConstructorArgumentsTracker(specimenBuilder, type.GetConstructors().Single());

            var instance = tracker.CreateNewInstance();
            var anotherInstance = tracker.CreateNewInstanceWithTheSameCtorArgsAsIn(instance);

            yield return new EqualityTestCase(instance, anotherInstance, true);

            foreach (var distinctInstance in tracker.CreateDistinctInstancesByChaningOneByOneCtorArgIn(instance))
            {
                yield return new EqualityTestCase(instance, distinctInstance, false);
            }
        }