コード例 #1
0
        public void WhenAValidCommandIsGivenShouldBeValid()
        {
            //Given
            var command = new CreditTransactionCommand(
                Guid.NewGuid(),
                "description",
                100M
                );

            //When
            command.Validate();

            //Then
            Assert.True(command.Valid);
        }
コード例 #2
0
        public void WhenAnInvalidcommandIsGivenShouldNotBeValid()
        {
            //Given
            var command = new CreditTransactionCommand(
                Guid.Empty,
                "",
                0M
                );

            //When
            command.Validate();

            //Then
            Assert.True(command.Invalid);
            Assert.Equal(3, command.Notifications.Count);
        }