コード例 #1
0
        public void LoadFromFile()
        {
            var tile = new StringTile(
                "value"
                );

            Assert.That(tile.Name, Is.Null);
            Assert.That(tile.Render(null), Is.EqualTo("value"));
        }
コード例 #2
0
        public void TheRenderingShouldBeDelegatedToTheReferenceTileInCaseOfFallBack()
        {
            var model    = new TagModel(new object());
            var fallBack = new StringTile("val");
            var map      = new TilesMap();
            var tile     = new TileReference("name", map, fallBack);

            tile.GuardInit();
            Assert.That(tile.Render(model), Is.EqualTo((fallBack.Render(model))));
        }
コード例 #3
0
        public void TheRenderingShouldBeDelegatedToTheReferenceTileInCase()
        {
            var model    = new TagModel(new object());
            var fallBack = new StringTile("val");
            var source   = new MockTile("name");
            var map      = new TilesMap();

            map.AddTile(source);
            var tile = new TileReference(source.Name, map, fallBack);

            tile.GuardInit();
            Assert.That(fallBack.Render(model), Is.Not.EqualTo((source.Render(model))), "Precondition");
            Assert.That(tile.Render(model), Is.EqualTo((source.Render(model))));
        }