コード例 #1
0
ファイル: Entity_Tests.cs プロジェクト: xackill/01-quality
        public void AddParsedSubEntitiesWithBubbling_should_not_add_insignificant_leaves()
        {
            const string rawText = "RawText";
            var correctAnswer = new TestEntity(rawText);

            var testEnity = new TestEntity(rawText);
            var insignficantLeaf = new[] { (Entity) new ParsedTextEntity(rawText) }.ToList();
            testEnity.AddParsedSubEntitiesWithBubbling(insignficantLeaf);

            Assert.AreEqual(correctAnswer, testEnity);
        }
コード例 #2
0
ファイル: Entity_Tests.cs プロジェクト: xackill/01-quality
        public void AddParsedSubEntitiesWithBubbling_should_delete_insignificant_entities_using_bubbling()
        {
            var bottomLvl = ParseStringIntoTestEntities("test test");

            var topLvl = "test test text test"
                        .Split(' ')
                        .Select(s => s == "test" ? (Entity) new TestEntity(s) : new RawTextEntity(bottomLvl))
                        .ToList();

            var correctAnswerSubEntities = ParseStringIntoTestEntities("test test test test test");
            var correctAnswer = new TestEntity(correctAnswerSubEntities);

            var testEnity = new TestEntity("");
            testEnity.AddParsedSubEntitiesWithBubbling(topLvl);

            Assert.AreEqual(correctAnswer, testEnity);
        }
コード例 #3
0
ファイル: Entity_Tests.cs プロジェクト: xackill/01-quality
 public void AddParsedSubEntitiesWithBubbling_should_not_throw_when_argument_is_null()
 {
     var testEnity = new TestEntity("RawText");
     Assert.DoesNotThrow(delegate { testEnity.AddParsedSubEntitiesWithBubbling(null); });
 }