Example #1
0
        public async Task GetActorById_ActorWithIdExists_ActorWithId()
        {
            //Arrange
            var expected = new ActorBuilder().WithId(2).Build();
            var context  = GenerateEnumerableEmptyContextMock();
            var service  = new ActorsService(context.Object);

            context.Setup(x => x.Actors.FindAsync(2)).ReturnsAsync(expected);

            //Act
            var actor = await service.GetActorById(2);

            //Assert
            Assert.Equal(expected.Id, actor.Id);
        }