コード例 #1
0
        public async Task UploadRightDiff_success()
        {
            //Arrange
            RightDataViewModel fakeData = new RightDataViewModel()
            {
                Id        = new Guid(),
                RightData = "abcdefg"
            };

            _diffAppServiceMock.Setup(x => x.SaveRightData(It.IsAny <RightDataViewModel>()))
            .Returns(Task.CompletedTask);

            //Act
            var diffController = new DiffController(_diffAppServiceMock.Object);

            diffController.ControllerContext.HttpContext = _contextMock.Object;
            var actionResult = await diffController.UploadRightDiff(fakeData);

            //Assert
            Assert.Equal((actionResult as OkResult).StatusCode, (int)System.Net.HttpStatusCode.OK);
        }