Пример #1
0
        public void DecorateOfOneFileOneAttributeTiles()
        {
            var config = new MockConfiguration("a", DateTime.Now)
            {
                Factory = _locatorFactory
            };

            config.Entries.Add(new MockTileEntry
            {
                Name           = "a",
                Path           = "a.htm",
                TileAttributes = new List <IAttributeEntry> {
                    new MockAttributeEntry
                    {
                        Name  = "b",
                        Value = "value"
                    }
                }
            });
            var set = TilesFactory.AssembleFor(config).Map;

            Assert.That(set.Tiles.Count, Is.EqualTo(1));
            Assert.That(set.Contains("a"));
            TemplateTile tile = (TemplateTile)set.Get("a");

            Assert.That(tile.Attributes, Is.Not.Null);
            Assert.That(tile.Attributes.Count, Is.EqualTo(1));
            Assert.That(tile.Attributes["b"], Is.Not.Null);
        }
Пример #2
0
        public void SetTiles(IConfiguration configuration)
        {
            var newMap = TilesFactory.AssembleFor(configuration).Map;
            var oldMap = Map;

            _map = newMap;
            oldMap.Clear();
        }
Пример #3
0
        public void DecorateOfOnlyOneFileTiles()
        {
            var config = new MockConfiguration("a", DateTime.Now)
            {
                Factory = _locatorFactory
            };

            config.Entries.Add(new MockTileEntry
            {
                Name = "a",
                Path = "a.htm"
            });
            var set = TilesFactory.AssembleFor(config).Map;

            Assert.That(set.Tiles.Count, Is.EqualTo(1));
            Assert.That(set.Contains("a"));
        }