Exemplo n.º 1
0
        public async Task DivideByZero_Then_WillFail(int dividend, int divisor)
        {
            var sut        = new DivService();
            var parameters = new DivParams()
            {
                Dividend = dividend,
                Divisor  = divisor,
            };

            await Assert.ThrowsAnyAsync <DivideByZeroException>(() => sut.Execute(parameters));
        }
Exemplo n.º 2
0
        public async Task Should_Divide_When_Invoke(int dividend, int divisor, int quotient, int remainder)
        {
            var sut        = new DivService();
            var parameters = new DivParams()
            {
                Dividend = dividend,
                Divisor  = divisor,
            };

            var result = await sut.Execute(parameters);

            Assert.Equal(quotient, result.Quotient);
            Assert.Equal(remainder, result.Remainder);
        }