public void LookupReferencedAgeSettingUnsuccessfully() { var varRef = new VariableRef { PackageId = TestPackageId, VariableName = "var.name" }; var variableInfo = loader.LookupReferencedVariable(varRef); variableInfo.Should().BeNull(); errorCache.ShouldContain($"Could not find variable: '{varRef.ToFullName()}'"); }
public void ExtractVariableWithErrors(object value, object defaultValue, string supportedType, string unit, string errorMessage) { var variable = new Variable { Name = "Test", Value = value?.ToString(), Default = defaultValue?.ToString(), Type = supportedType, Units = unit }; var errorCache = new ErrorCacheMock(); var info = VariableInfo.Extract(variable, "myPackage", errorCache); errorCache.ShouldContain(errorMessage); info.HasErrors.Should().BeTrue(); }