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);
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 5
0
 public void TestChar()
 {
     Assert.AreEqual(ExpectedChar, ObjectCreatorExtensions.Create <char>(_defaultData));
 }
Exemplo n.º 6
0
 public void TestUInt()
 {
     Assert.AreEqual(ExpectedUInt, ObjectCreatorExtensions.Create <uint>(_defaultData));
 }
Exemplo n.º 7
0
 public void TestByte()
 {
     Assert.AreEqual(ExpectedByte, ObjectCreatorExtensions.Create <byte>(_defaultData));
 }
Exemplo n.º 8
0
 public void TestDateTime()
 {
     Assert.AreEqual(ExpectedDateTime, ObjectCreatorExtensions.Create <DateTime>(_defaultData));
 }
Exemplo n.º 9
0
 public void TestDecimal()
 {
     Assert.AreEqual(ExpectedDecimal, ObjectCreatorExtensions.Create <decimal>(_defaultData));
 }
Exemplo n.º 10
0
 public void TestImmutableQueueEnumerator()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableQueue <string> .Enumerator>());
 }
Exemplo n.º 11
0
 public void TestNameValueCollection()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <NameValueCollection>());
 }
Exemplo n.º 12
0
 public void TestNameObjectCollectionBase()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <NameObjectCollectionBase>());
 }
Exemplo n.º 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> >());
 }
Exemplo n.º 16
0
 public void TestImmutableHashSet()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableHashSet <string> >());
 }
Exemplo n.º 17
0
 public void TestImmutableSortedDictionaryEnumerator()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableSortedDictionary <string, int> .Enumerator>());
 }
Exemplo n.º 18
0
 public void TestStringCollection()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <StringCollection>());
 }
Exemplo n.º 19
0
 public void TestBool()
 {
     Assert.AreEqual(ExpectedBool, ObjectCreatorExtensions.Create <bool>(_defaultData));
 }
Exemplo n.º 20
0
 public void TestStringDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <StringDictionary>());
 }
Exemplo n.º 21
0
 public void TestString()
 {
     Assert.AreEqual(ExpectedString, ObjectCreatorExtensions.Create <string>(_defaultData));
 }
Exemplo n.º 22
0
 public void TestStringEnumerator()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <StringEnumerator>());
 }
Exemplo n.º 23
0
 public void TestGenericList()
 {
     Assert.AreEqual(ExpectedList, ObjectCreatorExtensions.Create <List <string> >(_defaultData));
 }
Exemplo n.º 24
0
 public void TestBitVector32Section()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <BitVector32.Section>());
 }
Exemplo n.º 25
0
 public void TestUShort()
 {
     Assert.AreEqual(ExpectedUShort, ObjectCreatorExtensions.Create <ushort>(_defaultData));
 }
Exemplo n.º 26
0
 public void TestIOrderedDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <IOrderedDictionary>());
 }
Exemplo n.º 27
0
 public void TestULong()
 {
     Assert.AreEqual(ExpectedULong, ObjectCreatorExtensions.Create <ulong>(_defaultData));
 }
Exemplo n.º 28
0
 public void TestImmutableStack()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <IImmutableStack <string> >());
 }
Exemplo n.º 29
0
 public void TestFloat()
 {
     Assert.AreEqual(ExpectedFloat, ObjectCreatorExtensions.Create <float>(_defaultData));
 }
Exemplo n.º 30
0
 public void TestImmutableDictionary()
 {
     Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableDictionary <string, int> >());
 }