public void WhenTheNameNoMatchThenThrows() { var applier = new SubclassDiscriminatorValueAsEnumValueApplier <Item, EntitiesTypesFixed>(); var mapper = new Mock <ISubclassAttributesMapper>(); applier.Executing(a => a.Apply(typeof(Gallery), mapper.Object)).Throws <ArgumentException>(); }
public void AlwaysMatch() { // the pattern can match only when called for subclass var applier = new SubclassDiscriminatorValueAsEnumValueApplier <Item, EntitiesTypes>(); applier.Match(typeof(Item)).Should().Be.True(); }
public void WhenTheNameNoMatchThenThrows() { var applier = new SubclassDiscriminatorValueAsEnumValueApplier<Item, EntitiesTypesFixed>(); var mapper = new Mock<ISubclassAttributesMapper>(); applier.Executing(a => a.Apply(typeof(Gallery), mapper.Object)).Throws<ArgumentException>(); }
public void WhenTheNameMatchThenApplyEnumValue() { var applier = new SubclassDiscriminatorValueAsEnumValueApplier <Item, EntitiesTypes>(); var mapper = new Mock <ISubclassAttributesMapper>(); applier.Apply(typeof(Contribute), mapper.Object); mapper.Verify(cm => cm.DiscriminatorValue(It.Is <int>(n => ((int)EntitiesTypes.Contribute).Equals(n)))); }
public void WhenTheNameMatchThenApplyEnumValue() { var applier = new SubclassDiscriminatorValueAsEnumValueApplier<Item, EntitiesTypes>(); var mapper = new Mock<ISubclassAttributesMapper>(); applier.Apply(typeof(Contribute), mapper.Object); mapper.Verify(cm => cm.DiscriminatorValue(It.Is<int>(n => ((int)EntitiesTypes.Contribute).Equals(n)))); }
public void WhenOutsideTheDefinedHierarchyThenNoMatch() { var applier = new SubclassDiscriminatorValueAsEnumValueApplier <Item, EntitiesTypes>(); applier.Match(typeof(SomethingOutOfHierarchy)).Should().Be.False(); }
public void WhenOutsideTheDefinedHierarchyThenNoMatch() { var applier = new SubclassDiscriminatorValueAsEnumValueApplier<Item, EntitiesTypes>(); applier.Match(typeof(SomethingOutOfHierarchy)).Should().Be.False(); }
public void AlwaysMatch() { // the pattern can match only when called for subclass var applier = new SubclassDiscriminatorValueAsEnumValueApplier<Item, EntitiesTypes>(); applier.Match(typeof(Item)).Should().Be.True(); }