Beispiel #1
0
        public void AddFiltersWithComplexAndComplexExpression()
        {
            // Arrange
            var          result = new TranslationResult();
            const string filter = "name eq '123' or name eq '222'";

            // Act
            result.AddFilter(filter);
            result.AddFilter(filter);

            // Assert
            Assert.NotNull(result.TableQuery);
            Assert.Equal(string.Format("({0}) and ({1})", filter, filter), result.TableQuery.FilterString);
        }
Beispiel #2
0
        public void AddFilterTwice()
        {
            // Arrange
            var          result = new TranslationResult();
            const string filter = "name eq '123'";

            // Act
            result.AddFilter(filter);
            result.AddFilter(filter);

            // Assert
            Assert.NotNull(result.TableQuery);
            Assert.Equal(string.Format("{0} and {0}", filter), result.TableQuery.FilterString);
        }
Beispiel #3
0
        public void AddFiltersWithSimpleAndComplexExpression()
        {
            // Arrange
            var          result  = new TranslationResult();
            const string simple  = "name eq '333'";
            const string complex = "name eq '123' or name eq '222'";

            // Act
            result.AddFilter(simple);
            result.AddFilter(complex);

            // Assert
            Assert.NotNull(result.TableQuery);
            Assert.Equal(string.Format("{0} and ({1})", simple, complex), result.TableQuery.FilterString);
        }
Beispiel #4
0
        public void AddNullFilter()
        {
            // Arrange
            var result = new TranslationResult();

            // Act && Assert
            Assert.Throws <ArgumentNullException>(() => result.AddFilter(null));
        }
Beispiel #5
0
        public void AddFilter()
        {
            // Arrange
            var          result = new TranslationResult();
            const string filter = "name eq '123'";

            // Act
            result.AddFilter(filter);

            // Assert
            Assert.NotNull(result.TableQuery);
            Assert.Equal(filter, result.TableQuery.FilterString);
        }