예제 #1
0
        public void UpdateStudio_ShouldCallUnitOfWork_WhenParametersAreCorrect()
        {
            var repositoryMock = new Mock <IRepository <Studio> >();
            var unitOfWorkMock = new Mock <IUnitOfWork>();
            var factoryMock    = new Mock <IStudioFactory>();
            var studioMock     = new Mock <Studio>();
            var service        = new StudioService(repositoryMock.Object, unitOfWorkMock.Object, factoryMock.Object);

            service.UpdateStudio(studioMock.Object);

            unitOfWorkMock.Verify(r => r.Commit(), Times.Once);
        }
예제 #2
0
 public async Task <Studio> Put(int id, [FromBody] Studio value)
 {
     return(await studioService.UpdateStudio(id, value));
 }