예제 #1
0
        public async Task UpdatePhotoTags()
        {
            var photoIds    = _fixture.CreateMany <int>(5);
            var tagStates   = _fixture.CreateMany <TagState>(5);
            var batchUpdate = new BatchUpdateTags
            {
                PhotoIds  = photoIds.ToList(),
                TagStates = tagStates.ToList()
            };

            _photosService.Setup(m => m.UpdatePhotoTags(It.IsAny <List <int> >(), It.IsAny <List <string> >(), It.IsAny <List <int> >()));

            var response = await _tagsController.TagPhotos(batchUpdate);

            _photosService.Verify(m => m.UpdatePhotoTags(It.IsAny <List <int> >(), It.IsAny <List <string> >(), It.IsAny <List <int> >()),
                                  Times.Once);

            Assert.IsType <OkResult>(response);
        }