Exemple #1
0
        public async Task AbrirComandaServiceTest()
        {
            int idComanda = 5;

            var repository = new Mock <IComandaRepository>();

            repository.Setup(s => s.AbrirComandaAsync())
            .Returns(Task.Run(() => idComanda));


            var service = new ComandaService(repository.Object);

            var result = await service.AbrirComandaAsync();

            Assert.Equal(result, idComanda);
        }