Example #1
0
        public void DataIsNull()
        {
            //Arrange
            InitParcer();

            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(null, true, false, true);

            //Assert
            Assert.NotNull(result);
            Assert.Equal("list of Data is null or Empty", result.Error);
        }
Example #2
0
        public void GetResultsMinBiggerMax()
        {
            //Arrange
            InitParcer();
            var numberOfResults = 4;

            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(TestMunroData2, false, false, false, 0, 60, 30);

            //Assert
            Assert.NotNull(result);
            Assert.Equal("Minimum cannot be larger than maximum", result.Error);
        }
Example #3
0
        public void GetResultsExcludingMax()
        {
            //Arrange
            InitParcer();
            var numberOfResults = 4;

            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(TestMunroData2, false, false, false, 0, 0, 90);

            //Assert
            Assert.NotNull(result);
            Assert.Equal(numberOfResults, result.MunroList.Count);
        }
Example #4
0
        public void GetLimitResultsNotSet()
        {
            //Arrange
            InitParcer();
            var numberOfResults = TestMunroData2.Count;

            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(TestMunroData2, true, true, true);

            //Assert
            Assert.NotNull(result);
            Assert.Equal(numberOfResults, result.MunroList.Count);
        }
Example #5
0
        public void FilterAlphabeDesc()
        {
            //Arrange
            InitParcer();

            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(TestMunroData, false, true, false);

            //Assert
            Assert.NotNull(result);
            Assert.Equal("C", result.MunroList[0].Name);
            Assert.Equal("A", result.MunroList[2].Name);
        }
Example #6
0
        public void FilterHeightAsceding()
        {
            //Arrange
            InitParcer();

            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(TestMunroData, true, false, true);

            //Assert
            Assert.NotNull(result);
            Assert.Equal(34, result.MunroList[0].Height);
            Assert.Equal(91, result.MunroList[2].Height);
        }
Example #7
0
        public void FilterBoth()
        {
            //Arrange
            InitParcer();


            //Act
            var query  = new MunroQueries();
            var result = query.SortByHeighAndAlphabet(TestMunroData2, true, true, true);

            //Assert
            Assert.NotNull(result);
            Assert.Equal("A", result.MunroList[0].Name);
            Assert.Equal("A", result.MunroList[1].Name);
            Assert.Equal("A", result.MunroList[2].Name);
            Assert.Equal(36, result.MunroList[0].Height);
            Assert.Equal(66, result.MunroList[1].Height);
            Assert.Equal(68, result.MunroList[2].Height);
        }