Beispiel #1
0
        public void Contains_is_IsSupersetOf()
        {
            var c = ContextWithPlusSeparator();

            CKTrait m = c.FindOrCreate("Beta+Alpha+Fridge+Combo");

            c.EmptyTrait.IsSupersetOf(c.EmptyTrait).Should().BeTrue("Empty is contained by definition in itself.");
            m.IsSupersetOf(c.EmptyTrait).Should().BeTrue("Empty is contained by definition.");
            m.IsSupersetOf(c.FindOrCreate("Fridge+Alpha")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge+Alpha+Combo")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge+Alpha+Beta+Combo")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge+Lol")).Should().BeFalse();
            m.IsSupersetOf(c.FindOrCreate("Murfn")).Should().BeFalse();
            m.IsSupersetOf(c.FindOrCreate("Fridge+Alpha+Combo+Lol")).Should().BeFalse();
            m.IsSupersetOf(c.FindOrCreate("Lol+Fridge+Alpha+Beta+Combo")).Should().BeFalse();

            m.Overlaps(c.FindOrCreate("Fridge+Alpha")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("Nimp+Fridge+Mourfn")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("Fridge+Alpha+Combo+Albert")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("ZZF+AAlp+BBeBe+Combo")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("AFridge+ALol")).Should().BeFalse();
            m.Overlaps(c.FindOrCreate("Murfn")).Should().BeFalse();
            m.Overlaps(c.FindOrCreate("QF+QA+QC+QL")).Should().BeFalse();
            m.Overlaps(c.EmptyTrait).Should().BeFalse("Empty is NOT contained 'ONE' since EmptyTrait.AtomicTraits.Count == 0...");
            c.EmptyTrait.Overlaps(c.EmptyTrait).Should().BeFalse("Empty is NOT contained 'ONE' in itself.");
        }
Beispiel #2
0
        public void trait_separator_can_be_changed_from_the_default_pipe()
        {
            var     c = new CKTraitContext("SemiColonContext", ';');
            CKTrait m = c.FindOrCreate("Beta;Alpha;Fridge;Combo");

            c.EmptyTrait.IsSupersetOf(c.EmptyTrait).Should().BeTrue("Empty is contained by definition in itself.");
            m.IsSupersetOf(c.EmptyTrait).Should().BeTrue("Empty is contained by definition.");
            m.IsSupersetOf(c.FindOrCreate("Fridge;Alpha")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge;Alpha;Combo")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge;Alpha;Beta;Combo")).Should().BeTrue();
            m.IsSupersetOf(c.FindOrCreate("Fridge;Lol")).Should().BeFalse();
            m.IsSupersetOf(c.FindOrCreate("Murfn")).Should().BeFalse();
            m.IsSupersetOf(c.FindOrCreate("Fridge;Alpha;Combo+Lol")).Should().BeFalse();
            m.IsSupersetOf(c.FindOrCreate("Lol;Fridge;Alpha;Beta;Combo")).Should().BeFalse();

            m.Overlaps(c.FindOrCreate("Fridge;Alpha")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("Nimp;Fridge;Mourfn")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("Fridge;Alpha;Combo;Albert")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("ZZF;AAlp;BBeBe;Combo")).Should().BeTrue();
            m.Overlaps(c.FindOrCreate("AFridge;ALol")).Should().BeFalse();
            m.Overlaps(c.FindOrCreate("Murfn")).Should().BeFalse();
            m.Overlaps(c.FindOrCreate("QF;QA;QC;QL")).Should().BeFalse();
            m.Overlaps(c.EmptyTrait).Should().BeFalse("Empty is NOT contained 'ONE' since EmptyTrait.AtomicTraits.Count == 0...");
            c.EmptyTrait.Overlaps(c.EmptyTrait).Should().BeFalse("Empty is NOT contained 'ONE' in itself.");
        }
Beispiel #3
0
        public void Contains_is_IsSupersetOf()
        {
            CKTrait m = Context.FindOrCreate("Beta+Alpha+Fridge+Combo");

            Assert.That(Context.EmptyTrait.IsSupersetOf(Context.EmptyTrait), "Empty is contained by definition in itself.");
            Assert.That(m.IsSupersetOf(Context.EmptyTrait), "Empty is contained by definition.");
            Assert.That(m.IsSupersetOf(Context.FindOrCreate("Fridge+Alpha")));
            Assert.That(m.IsSupersetOf(Context.FindOrCreate("Fridge")));
            Assert.That(m.IsSupersetOf(Context.FindOrCreate("Fridge+Alpha+Combo")));
            Assert.That(m.IsSupersetOf(Context.FindOrCreate("Fridge+Alpha+Beta+Combo")));
            Assert.That(!m.IsSupersetOf(Context.FindOrCreate("Fridge+Lol")));
            Assert.That(!m.IsSupersetOf(Context.FindOrCreate("Murfn")));
            Assert.That(!m.IsSupersetOf(Context.FindOrCreate("Fridge+Alpha+Combo+Lol")));
            Assert.That(!m.IsSupersetOf(Context.FindOrCreate("Lol+Fridge+Alpha+Beta+Combo")));

            Assert.That(m.Overlaps(Context.FindOrCreate("Fridge+Alpha")));
            Assert.That(m.Overlaps(Context.FindOrCreate("Nimp+Fridge+Mourfn")));
            Assert.That(m.Overlaps(Context.FindOrCreate("Fridge+Alpha+Combo+Albert")));
            Assert.That(m.Overlaps(Context.FindOrCreate("ZZF+AAlp+BBeBe+Combo")));
            Assert.That(!m.Overlaps(Context.FindOrCreate("AFridge+ALol")));
            Assert.That(!m.Overlaps(Context.FindOrCreate("Murfn")));
            Assert.That(!m.Overlaps(Context.FindOrCreate("QF+QA+QC+QL")));
            Assert.That(!m.Overlaps(Context.EmptyTrait), "Empty is NOT contained 'ONE' since EmptyTrait.AtomicTraits.Count == 0...");
            Assert.That(!Context.EmptyTrait.Overlaps(Context.EmptyTrait), "Empty is NOT contained 'ONE' in itself.");
        }