Ejemplo n.º 1
0
        public void SetupFilter_Compare_TwoSetupFilters_With_CustomWhere_ShouldBe_Different()
        {
            var filter1 = new SetupFilter();
            var filter2 = new SetupFilter();

            filter1.AddCustomerWhere("where 1");
            filter2.AddCustomerWhere("where 2");

            Assert.NotEqual(filter1, filter2);
            Assert.False(filter1 == filter2);

            filter1 = new SetupFilter();
            filter2 = new SetupFilter();

            filter1.AddCustomerWhere("");
            filter2.AddCustomerWhere("a");

            Assert.NotEqual(filter1, filter2);
            Assert.False(filter1 == filter2);

            filter1.AddCustomerWhere("b");
            filter2.AddCustomerWhere(null);

            Assert.NotEqual(filter1, filter2);
            Assert.False(filter1 == filter2);
        }
Ejemplo n.º 2
0
        public void SetupFilter_Compare_TwoSetupFilters_With_CustomWhere_ShouldBe_Equals()
        {
            var filter1 = new SetupFilter();
            var filter2 = new SetupFilter();

            filter1.AddCustomerWhere("where 1");
            filter2.AddCustomerWhere("where 1");

            Assert.Equal(filter1, filter2);
            Assert.True(filter1 == filter2);

            filter1 = new SetupFilter();
            filter2 = new SetupFilter();

            filter1.AddCustomerWhere("");
            filter2.AddCustomerWhere("");

            Assert.Equal(filter1, filter2);
            Assert.True(filter1 == filter2);

            filter1.AddCustomerWhere(null);
            filter2.AddCustomerWhere(null);

            Assert.Equal(filter1, filter2);
            Assert.True(filter1 == filter2);

            filter1.AddCustomerWhere("");
            filter2.AddCustomerWhere(null);

            Assert.Equal(filter1, filter2);
            Assert.True(filter1 == filter2);
        }