Beispiel #1
0
        public void ApplyFilter_Returns_Valid_OData()
        {
            var searchModel = new LearningAimsSearchModel
            {
                TeachingYears = new List <string>
                {
                    "1920"
                }
            };
            var oData = $"(AcademicYears/any(ay:ay/AcademicYear eq '{searchModel.TeachingYears.Single()}'))";

            var filter = new AcademicYearODataFilter();
            var result = filter.ApplyFilter(searchModel);

            result.Should().Be(oData);
        }
Beispiel #2
0
        public void ApplyFilter_Returns_Empty_String_For_No_Filter(string searchFilter)
        {
            var searchModel = new LearningAimsSearchModel
            {
                TeachingYears = new List <string>
                {
                    searchFilter
                }
            };
            var academicYearOData = string.Empty;

            var filter = new AcademicYearODataFilter();
            var result = filter.ApplyFilter(searchModel);

            result.Should().Be(academicYearOData);
        }