From 1fd8396a2fc6a37a7daaff5993e2bbddf3bb7ffc Mon Sep 17 00:00:00 2001 From: Alexander Raszka Date: Tue, 30 May 2023 21:58:23 +0200 Subject: [PATCH] #5 XUnit tests - Fix test Should_Remove_Existing --- src/ManiaTemplates/ManiaTemplateEngine.cs | 14 -------------- .../Components/MtComponentAttributesTest.cs | 1 + 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/ManiaTemplates/ManiaTemplateEngine.cs b/src/ManiaTemplates/ManiaTemplateEngine.cs index c4e84a5..db89124 100644 --- a/src/ManiaTemplates/ManiaTemplateEngine.cs +++ b/src/ManiaTemplates/ManiaTemplateEngine.cs @@ -121,20 +121,6 @@ public async Task PreProcessAsync(string key, IEnumerable assemblies) await PreProcessComponentAsync(GetComponent(key), ManialinkNameUtils.KeyToId(key), assemblies); } - /// - /// Renders a template in the given context. - /// - public string Render(string key, dynamic data, IEnumerable assemblies) - { - var assemblyList = assemblies.ToList(); - if (!_preProcessed.ContainsKey(key)) - { - PreProcess(key, assemblyList); - } - - return _preProcessed[key].Render(data); - } - /// /// Renders a template in the given context. /// diff --git a/tests/ManiaTemplates.Tests/Components/MtComponentAttributesTest.cs b/tests/ManiaTemplates.Tests/Components/MtComponentAttributesTest.cs index d6e7c16..9ab7df3 100644 --- a/tests/ManiaTemplates.Tests/Components/MtComponentAttributesTest.cs +++ b/tests/ManiaTemplates.Tests/Components/MtComponentAttributesTest.cs @@ -16,6 +16,7 @@ public void Should_Contain_Single_Attribute_Pair() [Fact] public void Should_Remove_Existing() { + _mtComponentAttributes["key"] = "value"; var result = _mtComponentAttributes.Pull("key"); Assert.Equal("value", result);