Exemplo n.º 1
0
        public void TestGetAllStations()
        {
            var controller = new PublicController(_context, _loggerFactory.CreateLogger <PublicController>());
            var result     = controller.GetStation();

            Assert.IsTrue(result.Count() == 3);
        }
Exemplo n.º 2
0
        public async System.Threading.Tasks.Task TestGetStationByIdAsync()
        {
            string expectedName = "Koluszki #2";
            var    controller   = new PublicController(_context, _loggerFactory.CreateLogger <PublicController>());
            var    result       = await controller.GetStation(2) as OkObjectResult;

            if (result?.Value as Station != null)
            {
                Assert.AreEqual("Koluszki #2", ((Station)result.Value).Name);
            }
            else
            {
                Assert.Fail();
            }
        }