Пример #1
0
        public void PuzzleGetFail()
        {
            var settingsMoq = new Mock <IOptions <AppSettings> >();

            settingsMoq.Setup(x => x.Value).Returns(testSettings);
            var                    controller   = new PuzzleController(settingsMoq.Object, testPuzzle);
            var                    result       = controller.Get(5);
            ActionResult           testResult   = (ActionResult)result.Result;
            BadRequestObjectResult objectResult = Assert.IsType <BadRequestObjectResult>(testResult);
        }
Пример #2
0
        public void PuzzleGetSuccess()
        {
            var settingsMoq = new Mock <IOptions <AppSettings> >();

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

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

            Assert.Equal("DDMW XJK TLUE ANCD", okObjectResult.Value);
        }