Beispiel #1
0
        public void ThrowsExceptionWhenTemplateNotFound()
        {
            var    templateProvider = new RuntimeEntityTemplateProvider(new EntityTemplate[0]);
            Action act = () => templateProvider.Get("NonExistantTemplate");

            act.ShouldThrow <EntityTemplateNotFoundException>();
        }
Beispiel #2
0
        public void PopulatesExceptionWhenTemplateNotFound()
        {
            var templateProvider = new RuntimeEntityTemplateProvider(new EntityTemplate[0]);
            var templateName     = "NonExistantTemplate";

            Action act = () => templateProvider.Get(templateName);

            act.ShouldThrow <EntityTemplateNotFoundException>().And.TemplateKey.Should().Be(templateName);
        }
Beispiel #3
0
        public void ThrowsOnDuplicateTemplateKey()
        {
            Action act = () =>
            {
                var templateProvider = new RuntimeEntityTemplateProvider(new[]
                {
                    new EntityTemplate("TestKey1", new IComponent[0]),
                    new EntityTemplate("TestKey1", new IComponent[0]),
                    new EntityTemplate("TestKey3", new IComponent[0])
                });
            };

            act.ShouldThrow <ArgumentException>();
        }