public void SetTemplateTmpWithBadVariablesNestedTest()
        {
            var validator = new TemplateValidator(new MockRandomTableService(), new MockTemplateService());

            var testVal = "[tmp:{Var 1 Test {Var 2}} Template]";

            var field = new TemplateField
            {
                Sort      = 1,
                Value     = testVal,
                FieldType = TemplateFieldType.Template
            };

            var(error, result) = validator.SetTemplateField(field).Result;

            var json = JsonConvert.DeserializeObject <TemplateTmp>(result.TemplateJson);

            Assert.AreEqual(ValidationError.InvalidTag, error, $"Validation error: {error.ToString()}");
            Assert.AreEqual("{Var 1 Test {Var 2}} Template", json.TemplateName, $"Table value was incorrect: {json}");
        }
        public void SetTemplateTmpExistsTrialingWhiteSpaceTest()
        {
            var validator = new TemplateValidator(new MockRandomTableService(), new MockTemplateService());

            var testVal = "[TMP: Test Template ]";

            var field = new TemplateField
            {
                Sort      = 1,
                Value     = testVal,
                FieldType = TemplateFieldType.Template
            };

            var(error, result) = validator.SetTemplateField(field).Result;

            var json = JsonConvert.DeserializeObject <TemplateTmp>(result.TemplateJson);

            Assert.AreEqual(ValidationError.None, error, $"Validation error: {error.ToString()}");
            Assert.AreEqual("Test Template", json.TemplateName, $"Template value was incorrect: {json}");
        }
        public void SetTemplateTmpWithVariablesTest()
        {
            var validator = new TemplateValidator(new MockRandomTableService(), new MockTemplateService());

            var testVal = "[tmp:{Var 1} Test {Var 2} Template]";

            var field = new TemplateField
            {
                Sort      = 1,
                Value     = testVal,
                FieldType = TemplateFieldType.Template
            };

            var(error, result) = validator.SetTemplateField(field).Result;

            var json = JsonConvert.DeserializeObject <TemplateTmp>(result.TemplateJson);

            Assert.AreEqual(ValidationError.None, error, $"Validation error: {error.ToString()}");
            Assert.AreEqual("{Var 1} Test {Var 2} Template", json.TemplateName, $"Table value was incorrect: {json}");
            Assert.IsTrue(json.Variables.Contains("Var 1"), "Var 1 is not in variable list");
            Assert.IsTrue(json.Variables.Contains("Var 2"), "Var 2 is not in variable list");
        }