コード例 #1
0
        public void InsertCommand_Valido()
        {
            var command = new NaturezaInsertCommand("Leve", 1, 1500, 20);

            command.Validate();
            var validacao = command.Invalid;

            Assert.False(validacao);
        }
コード例 #2
0
        public void InsertCommand_Invalido()
        {
            var command = new NaturezaInsertCommand("Lev", 1, 10, 10);

            command.Validate();
            var validacaoNome = command.Invalid;

            command = new NaturezaInsertCommand("Leve", 8, 10, 10);
            command.Validate();
            var validacaoPonto = command.Invalid;

            command = new NaturezaInsertCommand("Leve", 7, 0, 10);
            command.Validate();
            var validacaoValor = command.Invalid;

            command = new NaturezaInsertCommand("Leve", 7, 10, 35);
            command.Validate();
            var validacaoPercentual = command.Invalid;

            Assert.True(validacaoNome);
            Assert.True(validacaoPonto);
            Assert.True(validacaoValor);
            Assert.True(validacaoPercentual);
        }