public void CulturedBitmapWithRootNamespaceNoDirectoryPrefix() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl( FileUtilities.FixFilePath(@"SubFolder\SplashScreen.fr.bmp"), null, // Link file name false, "RootNamespace", // Root namespace null, null, null, null); Assert.Equal(@"RootNamespace.SplashScreen.bmp", result); }
public void CulturedResourcesFileWithRootNamespaceWithinSubfolder() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl( fileName: FileUtilities.FixFilePath(@"SubFolder\MyResource.fr.resources"), linkFileName: null, // Link file name prependCultureAsDirectory: false, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: null, culture: null, binaryStream: null, log: null); Assert.Equal(@"RootNamespace.MyResource.fr.resources", result); }
public void CulturedResourcesFileWithRootNamespaceWithinSubfolder() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl( FileUtilities.FixFilePath(@"SubFolder\MyResource.fr.resources"), null, // Link file name false, "RootNamespace", // Root namespace null, null, null, null); Assert.Equal(@"RootNamespace.MyResource.fr.resources", result); }
public void CulturedBitmapWithRootNamespaceNoDirectoryPrefix() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl( fileName: FileUtilities.FixFilePath(@"SubFolder\SplashScreen.fr.bmp"), linkFileName: null, // Link file name prependCultureAsDirectory: false, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: null, culture: null, binaryStream: null, log: null); Assert.Equal(@"RootNamespace.SplashScreen.bmp", result); }
private void AssertSimpleCase(string code, string expected) { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: "MyForm.resx", linkFileName: null, // Link file name prependCultureAsDirectory: true, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: "MyForm.vb", culture: null, binaryStream: StreamHelpers.StringToStream(code), log: null ); Assert.Equal(expected, result); }
public void ResourcesFileWithRootNamespace() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: @"MyResource.resources", linkFileName: null, // Link file name prependCultureAsDirectory: false, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: null, culture: null, binaryStream: null, log: null ); Assert.Equal(@"RootNamespace.MyResource.resources", result); }
public void ResourcesFileWithRootNamespace() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( @"MyResource.resources", null, // Link file name false, "RootNamespace", // Root namespace null, null, null, null ); Assert.Equal(@"RootNamespace.MyResource.resources", result); }
public void RootnamespaceWithCulture() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl( FileUtilities.FixFilePath(@"SubFolder\MyForm.en-GB.ResX"), null, // Link file name true, "RootNamespace", // Root namespace null, null, null, null); Assert.Equal("RootNamespace.MyForm.en-GB", result); }
private void AssertSimpleCase(string code, string expected) { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( "MyForm.resx", null, // Link file name true, "RootNamespace", // Root namespace "MyForm.vb", null, StreamHelpers.StringToStream(code), null ); Assert.Equal(expected, result); }
public void Regress222308() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( @"..\..\XmlEditor\Setup\XmlEditor.rgs", @"MyXmlEditor.rgs", true, "RootNamespace", // Root namespace null, null, null, null ); Assert.Equal("RootNamespace.MyXmlEditor.rgs", result); }
public void CulturedBitmapWithRootNamespace() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( @"SubFolder\SplashScreen.fr.bmp", null, // Link file name true, "RootNamespace", // Root namespace null, null, null, null ); Assert.Equal(@"fr\RootNamespace.SplashScreen.bmp", result); }
public void Regress222308() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: @"..\..\XmlEditor\Setup\XmlEditor.rgs", linkFileName: @"MyXmlEditor.rgs", prependCultureAsDirectory: true, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: null, culture: null, binaryStream: null, log: null ); Assert.Equal("RootNamespace.MyXmlEditor.rgs", result); }
public void Regress459265() { MockEngine m = new MockEngine(); CreateVisualBasicManifestResourceName c = new CreateVisualBasicManifestResourceName(); c.BuildEngine = m; string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( "MyForm.resx", null, true, "RootNamespace", // Root namespace (will be ignored because it's dependent) "MyForm.vb", null, StreamHelpers.StringToStream( @"Imports System #if false Namespace ClassLibrary1 #end if #if Debug Namespace ClassLibrary2 #else Namespace ClassLibrary3 #end if Class MyForm End Class End Namespace " ), c.Log ); Assert.IsTrue ( m.Log.Contains ( String.Format(AssemblyResources.GetString("CreateManifestResourceName.DefinitionFoundWithinConditionalDirective"), "MyForm.vb", "MyForm.resx") ) ); }
public void RootnamespaceWithCulture_RetainCultureInFileName() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: @"File.cs.vb", linkFileName: null, prependCultureAsDirectory: true, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: null, culture: null, binaryStream: null, log: null, treatAsCultureNeutral: true // retain culture in name ); // Visual basic does not carry subfolder. // See https://github.com/dotnet/msbuild/pull/5477 result.ShouldBe("RootNamespace.File.cs.vb"); }
public void RootnamespaceWithCulture() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl( fileName: FileUtilities.FixFilePath(@"SubFolder\MyForm.en-GB.ResX"), linkFileName: null, // Link file name prependCultureAsDirectory: // Link file name true, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: // Root namespace null, culture: null, binaryStream: null, log: null); Assert.Equal("RootNamespace.MyForm.en-GB", result); }
public void Regress459265() { MockEngine m = new MockEngine(); CreateVisualBasicManifestResourceName c = new CreateVisualBasicManifestResourceName(); c.BuildEngine = m; string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: "MyForm.resx", linkFileName: null, prependCultureAsDirectory: true, rootNamespace: "RootNamespace", // Root namespace (will be ignored because it's dependent) dependentUponFileName: "MyForm.vb", culture: null, binaryStream: StreamHelpers.StringToStream( @"Imports System #if false Namespace ClassLibrary1 #end if #if Debug Namespace ClassLibrary2 #else Namespace ClassLibrary3 #end if Class MyForm End Class End Namespace " ), log: c.Log ); Assert.Contains( String.Format(AssemblyResources.GetString("CreateManifestResourceName.DefinitionFoundWithinConditionalDirective"), "MyForm.vb", "MyForm.resx"), m.Log ); }
public void Regress419591() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( "MyForm.ro.resx", null, // Link file name true, "RootNamespace", // Root namespace "MyForm.ro.vb", null, StreamHelpers.StringToStream( @" Class MyForm End Class "), null ); Assert.Equal("RootNamespace.MyForm", result); }
public void Regress419591() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: "MyForm.ro.resx", linkFileName: null, // Link file name prependCultureAsDirectory: true, rootNamespace: "RootNamespace", // Root namespace dependentUponFileName: "MyForm.ro.vb", culture: null, binaryStream: StreamHelpers.StringToStream( @" Class MyForm End Class "), log: null ); Assert.Equal("RootNamespace.MyForm", result); }
public void Basic() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( fileName: @"f:\myproject\SubFolder\MyForm.resx", linkFileName: null, // Link file name prependCultureAsDirectory: true, rootNamespace: null, // Root namespace dependentUponFileName: null, culture: null, binaryStream: StreamHelpers.StringToStream( @" Namespace Nested.TestNamespace Class TestClass End Class End Namespace "), log: null ); Assert.Equal("Nested.TestNamespace.TestClass", result); }
public void Basic() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( @"f:\myproject\SubFolder\MyForm.resx", null, // Link file name true, null, // Root namespace null, null, StreamHelpers.StringToStream( @" Namespace Nested.TestNamespace Class TestClass End Class End Namespace "), null ); Assert.Equal("Nested.TestNamespace.TestClass", result); }
public void DependentWithEmbeddedCulture() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( @"f:\myproject\SubFolder\MyForm.fr-fr.resx", null, // Link file name true, "RootNamespace", // Root namespace null, null, StreamHelpers.StringToStream( @" Namespace Nested.TestNamespace Class TestClass End Class End Namespace "), null ); Assert.Equal("RootNamespace.Nested.TestNamespace.TestClass.fr-fr", result); }
public void DependentWithCultureMetadata() { string result = CreateVisualBasicManifestResourceName.CreateManifestNameImpl ( @"f:\myproject\SubFolder\MyForm.resx", null, // Link file name true, null, // Root namespace null, "en-GB", StreamHelpers.StringToStream( @" Namespace Nested.TestNamespace Class TestClass End Class End Namespace "), null ); Assert.AreEqual("Nested.TestNamespace.TestClass.en-GB", result); }