public void TestFor()
        {
            var objectCreationStrategy = new ObjectCreationStrategy(true, false, 0, null);
            var mock   = ObjectCreatorExtensions.Create <IPrimitivePropertyInterface>(CustomData, objectCreationStrategy);
            var errors = Analyze(mock, _dictionary).ToList();

            Assert.IsFalse(errors.Any(), ToErrorString(errors));
        }
        public static void Init(TestContext testContext)
        {
            var privateObject = CustomData.ToPrivateObject();

            _dictionary = privateObject.GetField <Dictionary <Type, object> >("_defaultData");
            var objectCreationStrategy = new ObjectCreationStrategy(true, false, 0, null);

            _mock = ObjectCreatorExtensions.Create <IInterfaceWithInterfaces>(CustomData, objectCreationStrategy);
        }
Beispiel #3
0
        internal static IEnumerable <T> CreateEnumerationWithObjects <T>(IDefaultData defaultData, ObjectCreationStrategy objectCreationStrategy)
        {
            var itemsCount = objectCreationStrategy.EnumerationCount;

            for (int i = 0; i < itemsCount; i++)
            {
                yield return(ObjectCreatorExtensions.Create <T>(defaultData, objectCreationStrategy));
            }
        }
Beispiel #4
0
        internal static IEnumerable <KeyValuePair <TKey, TValue> > CreateDictionaryEntries <TKey, TValue>(
            IDefaultData defaultData, ObjectCreationStrategy objectCreationStrategy)
        {
            var itemsCount = objectCreationStrategy.EnumerationCount;

            for (int i = 0; i < itemsCount; i++)
            {
                var key   = ObjectCreatorExtensions.Create <TKey>(defaultData, objectCreationStrategy);
                var value = ObjectCreatorExtensions.Create <TValue>(defaultData, objectCreationStrategy);
                yield return(new KeyValuePair <TKey, TValue>(key, value));
            }
        }
Beispiel #5
0
 public void TestChar()
 {
     Assert.AreEqual(ExpectedChar, ObjectCreatorExtensions.Create <char>(_defaultData));
 }
Beispiel #6
0
 public void TestUInt()
 {
     Assert.AreEqual(ExpectedUInt, ObjectCreatorExtensions.Create <uint>(_defaultData));
 }
Beispiel #7
0
 public void TestByte()
 {
     Assert.AreEqual(ExpectedByte, ObjectCreatorExtensions.Create <byte>(_defaultData));
 }
Beispiel #8
0
 public void TestDateTime()
 {
     Assert.AreEqual(ExpectedDateTime, ObjectCreatorExtensions.Create <DateTime>(_defaultData));
 }
Beispiel #9
0
 public void TestDecimal()
 {
     Assert.AreEqual(ExpectedDecimal, ObjectCreatorExtensions.Create <decimal>(_defaultData));
 }
Beispiel #10
0
 public void TestImmutableQueueEnumerator()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableQueue <string> .Enumerator>());
 }
Beispiel #11
0
 public void TestNameValueCollection()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <NameValueCollection>());
 }
Beispiel #12
0
 public void TestNameObjectCollectionBase()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <NameObjectCollectionBase>());
 }
Beispiel #13
0
 public void TestHybridDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <HybridDictionary>());
 }
 public void TestReadOnlyDictionaryValueCollection()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ReadOnlyDictionary <string, int> .ValueCollection>());
 }
 public void TestReadOnlyObservableCollection()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ReadOnlyObservableCollection <string> >());
 }
Beispiel #16
0
 public void TestImmutableHashSet()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableHashSet <string> >());
 }
Beispiel #17
0
 public void TestImmutableSortedDictionaryEnumerator()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableSortedDictionary <string, int> .Enumerator>());
 }
Beispiel #18
0
 public void TestStringCollection()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <StringCollection>());
 }
Beispiel #19
0
 public void TestBool()
 {
     Assert.AreEqual(ExpectedBool, ObjectCreatorExtensions.Create <bool>(_defaultData));
 }
Beispiel #20
0
 public void TestStringDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <StringDictionary>());
 }
Beispiel #21
0
 public void TestString()
 {
     Assert.AreEqual(ExpectedString, ObjectCreatorExtensions.Create <string>(_defaultData));
 }
Beispiel #22
0
 public void TestStringEnumerator()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <StringEnumerator>());
 }
Beispiel #23
0
 public void TestGenericList()
 {
     Assert.AreEqual(ExpectedList, ObjectCreatorExtensions.Create <List <string> >(_defaultData));
 }
Beispiel #24
0
 public void TestBitVector32Section()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <BitVector32.Section>());
 }
Beispiel #25
0
 public void TestUShort()
 {
     Assert.AreEqual(ExpectedUShort, ObjectCreatorExtensions.Create <ushort>(_defaultData));
 }
Beispiel #26
0
 public void TestIOrderedDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <IOrderedDictionary>());
 }
Beispiel #27
0
 public void TestULong()
 {
     Assert.AreEqual(ExpectedULong, ObjectCreatorExtensions.Create <ulong>(_defaultData));
 }
Beispiel #28
0
 public void TestImmutableStack()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <IImmutableStack <string> >());
 }
Beispiel #29
0
 public void TestFloat()
 {
     Assert.AreEqual(ExpectedFloat, ObjectCreatorExtensions.Create <float>(_defaultData));
 }
Beispiel #30
0
 public void TestImmutableDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableDictionary <string, int> >());
 }