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)));
        }
예제 #2
0
        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)));
        }
예제 #3
0
        public void WhenDecimalThenMatch()
        {
            var applier = new UseCurrencyForDecimalApplier();

            applier.Match(ForClass <MyClass> .Property(mc => mc.Price)).Should().Be.True();
        }
예제 #4
0
        public void WhenNoDecimalThenNoMatch()
        {
            var applier = new UseCurrencyForDecimalApplier();

            applier.Match(ForClass <MyClass> .Property(mc => mc.Value)).Should().Be.False();
        }
예제 #5
0
        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();
 }