Beispiel #1
0
        public void TestMergerReturnsNullIfBothInputAndDefaultAreNull()
        {
            var merger = new EntitySourceMerger(null);

            IEntitySource result = merger.FillEntitySourceGaps(null);

            Assert.IsNull(result);
        }
Beispiel #2
0
        public void TestMergerReturnsDefaultSourceCopyForNilInput()
        {
            IEntitySource source = new EntitySource("ns", "cnt", "id", "act");
            var           merger = new EntitySourceMerger(source);

            IEntitySource result = merger.FillEntitySourceGaps(null);

            Assert.AreNotSame(source, result);
            Assert.AreEqual(source, result);
        }
Beispiel #3
0
        public void TestNullUserFieldsAreAutocompleted()
        {
            IEntitySource source     = new EntitySource("ns", "cnt", "id", "act");
            IEntitySource userSource = new EntitySource(null, null, null, null);


            var           merger = new EntitySourceMerger(source);
            IEntitySource result = merger.FillEntitySourceGaps(userSource);

            Assert.AreEqual(source, result);
            Assert.AreNotSame(source, result);
        }
Beispiel #4
0
        public void TestUserFieldsHaveHigherPriority()
        {
            IEntitySource source     = new EntitySource("ns", "cnt", "id", "act");
            IEntitySource userSource = new EntitySource("userns", "usercnt", "userid", "useract");


            var           merger = new EntitySourceMerger(source);
            IEntitySource result = merger.FillEntitySourceGaps(userSource);

            Assert.AreEqual(userSource, result);
            Assert.AreNotSame(userSource, result);
        }