public void Create_PropertyTypeMissmatch_Exception() { var subject = new ArrayBuilder(); PropertyInfo missmatch = this.Property(nameof(TypeMismatch)); Assert.That(() => subject.Create(missmatch, null), Throws.InstanceOf <FormatException>()); }
public void Create_List_NoOp() { var subject = new ArrayBuilder(); PropertyInfo array = this.Property(nameof(List)); object noOp = subject.Create(array, null); Assert.That(noOp, Is.InstanceOf <NoSpecimen>()); }
public void Create_NoValues_EmptyInstance() { var subject = new ArrayBuilder(); PropertyInfo empty = this.Property(nameof(Empty)); object instance = subject.Create(empty, null); Assert.That(instance, Is.InstanceOf(empty.PropertyType).And.Empty); }
public void Create_NotAProperty_NoOp() { var subject = new ArrayBuilder(); object notAProperty = typeof(int); var noOp = subject.Create(notAProperty, null); Assert.That(noOp, Is.InstanceOf <NoSpecimen>()); }
public void Create_CompatibleMultiConversion_Instance() { var subject = new ArrayBuilder(); PropertyInfo compatible = this.Property(nameof(CompatibleMultiConversion)); object instance = subject.Create(compatible, null); Assert.That(instance, Is.InstanceOf(compatible.PropertyType)); }
public void Create_MultipleItems_Instance() { var subject = new ArrayBuilder(); PropertyInfo multipleItems = this.Property(nameof(MultipleItems)); object instance = subject.Create(multipleItems, null); Assert.That(instance, Is.InstanceOf(multipleItems.PropertyType).And.Length.GreaterThan(1)); }
public void Create_SingleItem_Instance() { var subject = new ArrayBuilder(); PropertyInfo singleItem = this.Property(nameof(SingleItem)); object instance = subject.Create(singleItem, null); Assert.That(instance, Is.InstanceOf(singleItem.PropertyType).And.Length.EqualTo(1)); }
public void Create_PropertyOfUnsupportedType_NoOp() { var subject = new ArrayBuilder(); PropertyInfo unhandledType = this.Property(nameof(Unhandled)); var noOp = subject.Create(unhandledType, null); Assert.That(noOp, Is.InstanceOf <NoSpecimen>()); }
public void Create_PropertyNotDecorated_NoOp() { var subject = new ArrayBuilder(); PropertyInfo notDecorated = this.Property(nameof(NotDecorated)); var noOp = subject.Create(notDecorated, null); Assert.That(noOp, Is.InstanceOf <NoSpecimen>()); }