Ejemplo n.º 1
0
        public void PostPuzzletest()
        {
            var settingsMoq = new Mock <IOptions <AppSettings> >();

            settingsMoq.Setup(x => x.Value).Returns(testSettings);
            var controller = new PuzzleController(settingsMoq.Object, testPuzzle);
            var result     = controller.Post(postRequestCorrect);

            ActionResult   testResult     = (ActionResult)result.Result;
            OkObjectResult okObjectResult = Assert.IsType <OkObjectResult>(testResult);
            PuzzleResponse response       = (PuzzleResponse)okObjectResult.Value;

            Assert.True(response.IsCorrect);
        }