예제 #1
0
        public void Filter_Fetch()
        {
            var filter = FilterTestHelper.FilterNew();

            filter = FilterRepository.FilterSave(filter);

            filter = FilterRepository.FilterFetch(filter.FilterId);

            Assert.IsTrue(filter != null, "Row returned should not equal null");
        }
예제 #2
0
        public void Filter_Add()
        {
            var filter = FilterTestHelper.FilterNew();

            Assert.IsTrue(filter.IsValid, "IsValid should be true");

            filter = FilterRepository.FilterSave(filter);

            Assert.IsTrue(filter.FilterId != 0, "FilterId should be a non-zero value");

            FilterRepository.FilterFetch(filter.FilterId);
        }
예제 #3
0
        public void Filter_Edit()
        {
            var filter = FilterTestHelper.FilterNew();

            var name = filter.Name;

            Assert.IsTrue(filter.IsValid, "IsValid should be true");

            filter = FilterRepository.FilterSave(filter);

            filter = FilterRepository.FilterFetch(filter.FilterId);

            filter.Name = DataHelper.RandomString(20);

            filter = FilterRepository.FilterSave(filter);

            filter = FilterRepository.FilterFetch(filter.FilterId);

            Assert.IsTrue(filter.Name != name, "Name should have different value");
        }
예제 #4
0
        public void Filter_Delete()
        {
            var filter = FilterTestHelper.FilterNew();

            Assert.IsTrue(filter.IsValid, "IsValid should be true");

            filter = FilterRepository.FilterSave(filter);

            filter = FilterRepository.FilterFetch(filter.FilterId);

            FilterRepository.FilterDelete(filter.FilterId);

            try
            {
                FilterRepository.FilterFetch(filter.FilterId);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetBaseException() is InvalidOperationException);
            }
        }