Exemplo n.º 1
0
        public async Task Update_ReturnsGuest()
        {
            // arrange
            var guest = new Guest {
                guestId = 123, name = "Guest1", email = "*****@*****.**", isGoing = true, eventId = 1
            };

            _guestQueryMock.Setup(x => x.Update(guest))
            .Returns(Task.Factory.StartNew(() => guest));

            // act
            var task = await _sut.Update(guest);

            // assert
            Assert.IsType <OkObjectResult>(task);

            var result      = task as OkObjectResult;
            var guestResult = result.Value as bool?;

            Assert.True(guestResult);
        }