Пример #1
0
        public void IsNotValid_IfNameNotSpecified()
        {
            var model = new DomainObjectBase( null )
             {
            Id = Guid.NewGuid(),
            Description = "This is a description"
             };

             Assert.IsFalse( model.IsValidFor( TransactionType.All ) );
        }
Пример #2
0
        public void IsNotValid_IfNameIsTooLong()
        {
            var model = new DomainObjectBase( null )
             {
            Id = Guid.NewGuid(),
            Name = "012345678901234567890123456789012345678901234567890",
            Description = "This is a description"
             };

             Assert.IsFalse( model.IsValidFor( TransactionType.All ) );
        }
Пример #3
0
        public void IsValid_IfEverythingIsValid()
        {
            var model = new DomainObjectBase( null )
             {
            Id = Guid.NewGuid(),
            Name = "01234567890123456789012345678901234567890123456789",
            Description = "This is a description"
             };

             Assert.IsTrue( model.IsValidFor( TransactionType.All ) );
             var messages = model.GetErrorMessages();
             Assert.AreEqual( 0, messages.Count );
        }
Пример #4
0
 private void AssertDomainModelsEqual( DomainObjectBase expected, DomainObjectBase actual )
 {
     Assert.AreEqual( expected.Id, actual.Id );
      Assert.AreEqual( expected.Name, actual.Name );
      Assert.AreEqual( expected.Description, actual.Description );
 }