public void Should_CreateNewStringUsingInitializer() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <string>(() => string.Empty); Assert.AreEqual(test.GetType(), typeof(string)); Assert.AreEqual(test, string.Empty); }
public void Should_CreateNewEnumerable() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <IEnumerable>(); var isEnumerable = test is IEnumerable <object>; // .Net Core 3+ no longer guarantees this list to be a object[], its now an internal unaccessible type of EmptyPartition Assert.IsTrue(isEnumerable); }
public void Should_CreateNewString() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <string>(); Assert.IsNull(test); }
public void Should_CreateNewDictionary() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <Dictionary <int, string> >(); Assert.AreEqual(test.GetType(), typeof(Dictionary <int, string>)); }
public void Should_CreateNewList() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <List <int> >(); Assert.AreEqual(test.GetType(), typeof(List <int>)); }
public void Should_CreateNewArray() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <byte[]>(); Assert.AreEqual(test.GetType(), typeof(byte[])); }
public void Should_CreateNewBasicObject() { var test = new TypeSupport.ObjectFactory().CreateEmptyObject <BasicObject>(); Assert.AreEqual(test.GetType(), typeof(BasicObject)); }