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); }
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)); } }
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)); } }
public void TestChar() { Assert.AreEqual(ExpectedChar, ObjectCreatorExtensions.Create <char>(_defaultData)); }
public void TestUInt() { Assert.AreEqual(ExpectedUInt, ObjectCreatorExtensions.Create <uint>(_defaultData)); }
public void TestByte() { Assert.AreEqual(ExpectedByte, ObjectCreatorExtensions.Create <byte>(_defaultData)); }
public void TestDateTime() { Assert.AreEqual(ExpectedDateTime, ObjectCreatorExtensions.Create <DateTime>(_defaultData)); }
public void TestDecimal() { Assert.AreEqual(ExpectedDecimal, ObjectCreatorExtensions.Create <decimal>(_defaultData)); }
public void TestImmutableQueueEnumerator() { Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableQueue <string> .Enumerator>()); }
public void TestNameValueCollection() { Assert.IsNotNull(ObjectCreatorExtensions.Create <NameValueCollection>()); }
public void TestNameObjectCollectionBase() { Assert.IsNotNull(ObjectCreatorExtensions.Create <NameObjectCollectionBase>()); }
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> >()); }
public void TestImmutableHashSet() { Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableHashSet <string> >()); }
public void TestImmutableSortedDictionaryEnumerator() { Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableSortedDictionary <string, int> .Enumerator>()); }
public void TestStringCollection() { Assert.IsNotNull(ObjectCreatorExtensions.Create <StringCollection>()); }
public void TestBool() { Assert.AreEqual(ExpectedBool, ObjectCreatorExtensions.Create <bool>(_defaultData)); }
public void TestStringDictionary() { Assert.IsNotNull(ObjectCreatorExtensions.Create <StringDictionary>()); }
public void TestString() { Assert.AreEqual(ExpectedString, ObjectCreatorExtensions.Create <string>(_defaultData)); }
public void TestStringEnumerator() { Assert.IsNotNull(ObjectCreatorExtensions.Create <StringEnumerator>()); }
public void TestGenericList() { Assert.AreEqual(ExpectedList, ObjectCreatorExtensions.Create <List <string> >(_defaultData)); }
public void TestBitVector32Section() { Assert.IsNotNull(ObjectCreatorExtensions.Create <BitVector32.Section>()); }
public void TestUShort() { Assert.AreEqual(ExpectedUShort, ObjectCreatorExtensions.Create <ushort>(_defaultData)); }
public void TestIOrderedDictionary() { Assert.IsNotNull(ObjectCreatorExtensions.Create <IOrderedDictionary>()); }
public void TestULong() { Assert.AreEqual(ExpectedULong, ObjectCreatorExtensions.Create <ulong>(_defaultData)); }
public void TestImmutableStack() { Assert.IsNotNull(ObjectCreatorExtensions.Create <IImmutableStack <string> >()); }
public void TestFloat() { Assert.AreEqual(ExpectedFloat, ObjectCreatorExtensions.Create <float>(_defaultData)); }
public void TestImmutableDictionary() { Assert.IsNotNull(ObjectCreatorExtensions.Create <ImmutableDictionary <string, int> >()); }