コード例 #1
0
        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()}'");
        }
コード例 #2
0
        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();
        }