Skip to content

Commit

Permalink
fixing sample program
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeclayton committed May 27, 2024
1 parent fac4cc6 commit 225e9a3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 36 deletions.
34 changes: 1 addition & 33 deletions src/Kingsland.MofParser.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,8 @@ instance of MSFT_RoleResource as $MSFT_RoleResource1ref
};
";

const string sourceText2 = @"
instance of CustomObject1 as $CustomObject11ref
{
Bool1 = True;
String1 = ""21Object1String1"";
};
instance of ClassBasedResource2 as $ClassBasedResource21ref
{
Key = ""2k1"";
ModuleVersion = ""0.1.0"";
Object1 = $CustomObject11ref;
Ensure = ""Present"";
SourceInfo = ""::3::1::ClassBasedResource2"";
ResourceID = ""[ClassBasedResource2]2k1::[ClassBasedResources2]ClassBasedResources2"";
ModuleName = ""ClassBased"";
ConfigurationName = ""RootConfiguration"";
};
instance of OMI_ConfigurationDocument
{
Version = ""2.0.0"";
MinimumCompatibleVersion = ""1.0.0"";
CompatibleVersionAdditionalProperties= {""Omi_BaseResource:ConfigurationName""};
Author=""randr"";
GenerationDate=""05/23/2024 14:06:44"";
GenerationHost=""RAANDREE0"";
Name=""MOF__ NA"";
};
";

// parse the mof file
var module = Parser.ParseText(sourceText2);
var module = Parser.ParseText(sourceText);

// display the instances
foreach (var instance in module.Instances)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Kingsland.MofParser.Ast;
using Kingsland.MofParser.Models;
using Kingsland.MofParser.Models.Types;
using Kingsland.MofParser.Models.Values;
using Kingsland.MofParser.Tokens;
Expand Down Expand Up @@ -139,7 +138,7 @@ instance of GOLF_ClubMember
PropertyName = new IdentifierToken("LastPaymentDate"),
PropertyValue = new ComplexValueAst.Builder {
Value = new IdentifierToken("value"),
Of = new IdentifierToken("of"),
Of = new IdentifierToken("of"),
TypeName = new IdentifierToken("GOLF_Date"),
PropertyValues = new PropertyValueListAst([
new(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Kingsland.MofParser.Ast;
using Kingsland.MofParser.Models.Types;
using Kingsland.MofParser.Models.Values;
using Kingsland.MofParser.Tokens;
using Kingsland.MofParser.UnitTests.Extensions;
using NUnit.Framework;
Expand Down

0 comments on commit 225e9a3

Please sign in to comment.