Exemplo n.º 1
0
        public async Task UploadLeftDiff_success()
        {
            //Arrange
            LeftDataViewModel fakeData = new LeftDataViewModel()
            {
                LeftData = "abcdefg"
            };

            _diffAppServiceMock.Setup(x => x.SaveLeftData(It.IsAny <LeftDataViewModel>()))
            .Returns(Task.FromResult(new Guid()));

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

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

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