public void Should_Mark_Box() { // Arrange var playerId = Guid.NewGuid(); var boxId = Guid.NewGuid(); boxServiceMock .Setup(m => m.Get(It.IsAny <Guid>())) .Returns(new Box { BoxId = boxId }); playerServiceMock .Setup(m => m.Get(It.IsAny <Guid>())) .Returns(new Player { }); unitOfWorkFactoryMock .Setup(m => m.Create()) .Returns(new UnitOfWork(ticTacToeContextMock.Object) { }); // Act var response = controller.Mark(playerId, boxId); var okResult = response.Result as OkObjectResult; var boxViewModel = okResult.Value as BoxViewModel; // Assert Assert.IsNotNull(okResult); Assert.AreEqual(okResult.StatusCode, 200); Assert.AreEqual(boxViewModel.BoxId, boxId); }