コード例 #1
0
        public void ValidatingEmptyCurrencyFails()
        {
            var sut = new ClassWithCurrencyAttribute()
            {
                Currency = string.Empty
            };

            Assert.IsFalse(sut.IsValid());
        }
コード例 #2
0
        public void ValidatingCurrencyFails()
        {
            var sut = new ClassWithCurrencyAttribute()
            {
                Currency = "XYZ"
            };

            Assert.IsFalse(sut.IsValid());
        }
コード例 #3
0
        public void ValidatingNullCurrencyFails()
        {
            var sut = new ClassWithCurrencyAttribute()
            {
                Currency = default(string)
            };

            Assert.IsFalse(sut.IsValid());
        }
コード例 #4
0
        public void ValidatingCurrencySucceeds()
        {
            var sut = new ClassWithCurrencyAttribute()
            {
                Currency = "EUR"
            };

            Assert.IsTrue(sut.IsValid());
        }