/// <summary> /// Loads the model using the information on the given resource to locate it. /// </summary> public static IPatternModelInfo Load(this ISchemaReader reader, ISchemaResource resource) { Guard.NotNull(() => reader, reader); Guard.NotNull(() => resource, resource); return(reader.Load(resource.CreateStream())); }
/// <summary> /// Loads the model using the information on the given resource to locate it. /// </summary> public static IPatternModelInfo Load(this ISchemaReader reader, ISchemaResource resource) { Guard.NotNull(() => reader, reader); Guard.NotNull(() => resource, resource); return reader.Load(resource.CreateStream()); }
public void Initialize() { this.mockExtension = new Mock<IInstalledExtension>(); this.extension = mockExtension.Object; this.reader = new Mock<ISchemaReader>().Object; this.resource = new Mock<ISchemaResource>().Object; this.target = new InstalledToolkitInfo(this.extension, this.reader, this.resource); }
public void Initialize() { this.mockExtension = new Mock <IInstalledExtension>(); this.extension = mockExtension.Object; this.reader = new Mock <ISchemaReader>().Object; this.resource = new Mock <ISchemaResource>().Object; this.target = new InstalledToolkitInfo(this.extension, this.reader, this.resource); }
/// <summary> /// Initializes a new instance of the <see cref="InstalledToolkitInfo"/> class. /// </summary> /// <param name="extension">The extension.</param> /// <param name="reader">The reader.</param> /// <param name="resource">The resource.</param> public InstalledToolkitInfo(IInstalledExtension extension, ISchemaReader reader, ISchemaResource resource) { Guard.NotNull(() => extension, extension); Guard.NotNull(() => reader, reader); Guard.NotNull(() => resource, resource); this.Extension = extension; this.reader = reader; this.resource = resource; this.PatternIconPath = null; this.ToolkitIconPath = GetIconFromExtension(extension); }
public void Initialize() { var mock = new Mock <IInstalledExtension>(); mock.Setup(ext => ext.InstallPath).Returns(@"X:\"); mock.Setup(ext => ext.Content).Returns( new[] { Mocks.Of <IExtensionContent>().First(c => c.ContentTypeName == InstalledToolkitInfo.PatternModelCustomExtensionName && c.RelativePath == @"Foo.patterndefinition" && c.Attributes == new Dictionary <string, string> { { SchemaResource.AssemblyFileProperty, "Test.dll" } }), Mocks.Of <IExtensionContent>().First(c => c.ContentTypeName == "Other" && c.RelativePath == @"Documentation\Other.docx" && c.Attributes == new Dictionary <string, string> { { "IsCustomizable", bool.TrueString } }), Mocks.Of <IExtensionContent>().First(c => c.ContentTypeName == "Other" && c.RelativePath == @"Sample.file" && c.Attributes == new Dictionary <string, string> { { "IsCustomizable", bool.TrueString } }), }); this.extension = mock.Object; this.reader = new Mock <ISchemaReader>().Object; this.resource = new Mock <ISchemaResource>().Object; this.target = new InstalledToolkitInfo(this.extension, this.reader, this.resource); }
public void InitializeContext() { this.extension = null; this.reader = new Mock<ISchemaReader>().Object; this.resource = new Mock<ISchemaResource>().Object; }
public void Initialize() { var mock = new Mock<IInstalledExtension>(); mock.Setup(ext => ext.InstallPath).Returns(@"X:\"); mock.Setup(ext => ext.Content).Returns( new[] { Mocks.Of<IExtensionContent>().First(c => c.ContentTypeName == InstalledToolkitInfo.PatternModelCustomExtensionName && c.RelativePath == @"Foo.patterndefinition" && c.Attributes == new Dictionary<string, string> { { SchemaResource.AssemblyFileProperty, "Test.dll" } }), Mocks.Of<IExtensionContent>().First(c => c.ContentTypeName == "Other" && c.RelativePath == @"Documentation\Other.docx" && c.Attributes == new Dictionary<string, string> { { "IsCustomizable", bool.TrueString } }), Mocks.Of<IExtensionContent>().First(c => c.ContentTypeName == "Other" && c.RelativePath == @"Sample.file" && c.Attributes == new Dictionary<string, string> { { "IsCustomizable", bool.TrueString } }), }); this.extension = mock.Object; this.reader = new Mock<ISchemaReader>().Object; this.resource = new Mock<ISchemaResource>().Object; this.target = new InstalledToolkitInfo(this.extension, this.reader, this.resource); }
public CMSClient(CMSClientConfig config) { Assets = new AssetResource(config); Documents = new DocumentResource(config); Schemas = new SchemaResource(config); }
public void InitializeContext() { this.extension = null; this.reader = new Mock <ISchemaReader>().Object; this.resource = new Mock <ISchemaResource>().Object; }