public void CreateNewBoardShouldBe201() { var newBoardRequest = new NewBoardRequest() { BoardName = "FirstBoard", PlayerName = "First Player" }; var setupServiceMock = new Mock <ISetupService>(); var generatedGuid = Guid.NewGuid(); setupServiceMock.Setup(m => m.CreateNewBoard(newBoardRequest)).Returns(generatedGuid); var setupController = new SetupController(setupServiceMock.Object); var response = setupController.CreateNewBoard(newBoardRequest); Assert.IsTrue(response.Result is CreatedResult); var responseValue = (response.Result as CreatedResult)?.Value; Assert.AreEqual(generatedGuid, responseValue); setupServiceMock.Verify(mock => mock.CreateNewBoard(newBoardRequest), Times.Once()); }