public void AlwaysApplyCurrencyType() { var propertyMapper = new Mock<IPropertyMapper>(); var applier = new UseCurrencyForDecimalApplier(); applier.Apply(ForClass<MyClass>.Property(x => x.Price), propertyMapper.Object); propertyMapper.Verify(x => x.Type(It.Is<IType>(t => t == NHibernateUtil.Currency))); }
public void AlwaysApplyCurrencyType() { var propertyMapper = new Mock <IPropertyMapper>(); var applier = new UseCurrencyForDecimalApplier(); applier.Apply(ForClass <MyClass> .Property(x => x.Price), propertyMapper.Object); propertyMapper.Verify(x => x.Type(It.Is <IType>(t => t == NHibernateUtil.Currency))); }
public void WhenDecimalThenMatch() { var applier = new UseCurrencyForDecimalApplier(); applier.Match(ForClass <MyClass> .Property(mc => mc.Price)).Should().Be.True(); }
public void WhenNoDecimalThenNoMatch() { var applier = new UseCurrencyForDecimalApplier(); applier.Match(ForClass <MyClass> .Property(mc => mc.Value)).Should().Be.False(); }
public void WhenNullThenNotThrows() { var applier = new UseCurrencyForDecimalApplier(); applier.Executing(a => a.Match(null)).NotThrows(); }
public void WhenNullThenNotThrows() { var applier = new UseCurrencyForDecimalApplier(); applier.Executing(a => a.Match(null)).NotThrows(); }
public void WhenNoDecimalThenNoMatch() { var applier = new UseCurrencyForDecimalApplier(); applier.Match(ForClass<MyClass>.Property(mc => mc.Value)).Should().Be.False(); }
public void WhenDecimalThenMatch() { var applier = new UseCurrencyForDecimalApplier(); applier.Match(ForClass<MyClass>.Property(mc => mc.Price)).Should().Be.True(); }