Пример #1
0
        public void RoutesRepository_GetRoutDetailsFeedbackFor_NullLanguage()
        {
            // Arrange
            int wrongOriginCityNodeID = 11;
            int destinationCityNodeID = 5;
            var repository = new RoutesRepository(_datacontext);
            var originCityNode = _datacontext.CityNodes.SingleOrDefault(m => m.CityNodeId == wrongOriginCityNodeID);
            var destinationCityNode = _datacontext.CityNodes.SingleOrDefault(m => m.CityNodeId == destinationCityNodeID);
            var routeNode = new RouteNode { RouteNodeId = 1, OriginCityNodeId = 11, DestinationCityNodeId = 5, OriginCityNode = originCityNode, DestinationCityNode = destinationCityNode };
            string lang = null;

            //Act
            var result = repository.GetRoutDetailsFeedbackFor(routeNode, lang);
        }
Пример #2
0
        public void RoutesRepository_GetRoutDetailsFeedbackFor_PosistiveTest(int originCityNodeID, int destinationCityNodeID, string lang, string[] expected)
        {
            // Arrange
            var repository = new RoutesRepository(_datacontext);
            var originCityNode = _datacontext.CityNodes.SingleOrDefault(m => m.CityNodeId == originCityNodeID);
            var destinationCityNode = _datacontext.CityNodes.SingleOrDefault(m => m.CityNodeId == destinationCityNodeID);
            var routeNode = new RouteNode
            {
                RouteNodeId = 1,
                OriginCityNodeId = 11,
                DestinationCityNodeId = 5,
                OriginCityNode = originCityNode,
                DestinationCityNode = destinationCityNode
            };

            //Act
            var result = repository.GetRoutDetailsFeedbackFor(routeNode, lang);

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, expected.Length);
            Assert.AreEqual(result[0].DestinationCityName, expected[0]);
            Assert.AreEqual(result[0].OriginCityName, expected[1]);
            for (int index = 0; index < result.Count; index++)
            {
                var resultItem = result[index];
                Assert.IsNotNull(resultItem);
            }
        }
Пример #3
0
        public void RoutesRepository_GetRoutDetailsFeedbackFor_WronrgOriginCity(int оriginCityNodeID, int destinationCityNodeID, string lang)
        {
            // Arrange
            var repository = new RoutesRepository(_datacontext);
            var originCityNode = _datacontext.CityNodes.SingleOrDefault(m => m.CityNodeId == оriginCityNodeID);
            var destinationCityNode = _datacontext.CityNodes.SingleOrDefault(m => m.CityNodeId == destinationCityNodeID);
            var routeNode = new RouteNode { RouteNodeId = 1, OriginCityNodeId = 11, DestinationCityNodeId = 5, OriginCityNode = originCityNode, DestinationCityNode = destinationCityNode };
            //string lang = "en";

            //Act
            var result = repository.GetRoutDetailsFeedbackFor(routeNode, lang);
        }