Ejemplo n.º 1
0
        public async void AddMakeAsync_Returns_Maker()
        {
            Guid guid  = Guid.NewGuid();
            var  maker = new Mock <IVehicleMake>();

            maker.Setup(s => s.Id).Returns(guid);
            repoMock.Setup(s => s.AddAsync(It.IsAny <IVehicleMake>())).Returns(Task.FromResult(maker.Object));
            uowMock.SetupGet(s => s.Makers).Returns(repoMock.Object);

            var makeService = new VehicleMakeService(uowMock.Object);
            var make        = await makeService.AddMakeAsync(maker.Object);

            //Assert
            Assert.NotNull(make);
            Assert.Equal(guid, make.Id);
        }