433 references to Utilities
Microsoft.Build.Tasks.UnitTests (433)
ResourceHandling\GenerateResource_Tests.cs (432)
56GenerateResource t = Utilities.CreateTask(_output); 57t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 61resxFile = Utilities.WriteTestResX(false, null, null); 71Utilities.ExecuteTask(t); 79Utilities.AssertStateFileWasWritten(t); 81Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", resxFile, resourcesFile); 82Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 1, resxFile); 109string resxFile0 = Utilities.WriteTestResX(false, null, null); 110string resxFile1 = Utilities.WriteTestResX(false, null, null); 111string resxFile2 = Utilities.WriteTestResX(false, null, null); 112string resxFile3 = Utilities.WriteTestResX(false, null, null); 116string expectedOutFile2 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources")); 117string expectedOutFile3 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources")); 119GenerateResource t = Utilities.CreateTask(_output); 126Utilities.ExecuteTask(t); 150GenerateResource t = Utilities.CreateTask(_output); 151t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 155string textFile = Utilities.WriteTestText(null, null); 159Utilities.ExecuteTask(t); 167Utilities.AssertStateFileWasWritten(t); 169Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 170Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 197string systemDll = Utilities.GetPathToCopiedSystemDLL(); 203GenerateResource t = Utilities.CreateTask(_output); 205resxFile = Utilities.WriteTestResX(true /*system type*/, null, null); 209Utilities.ExecuteTask(t); 215Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", resxFile, resourcesFile); 216Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 2, resxFile); 243string resourcesFile = Utilities.CreateBasicResourcesFile(false, _output); 246GenerateResource t = Utilities.CreateTask(_output); 249Utilities.ExecuteTask(t); 253GenerateResource t2a = Utilities.CreateTask(_output); 256Utilities.ExecuteTask(t2a); 260GenerateResource t2b = Utilities.CreateTask(_output); 262t2b.OutputResources = new ITaskItem[] { new TaskItem(Utilities.GetTempFileName(".resx")) }; 263Utilities.ExecuteTask(t2b); 267Assert.Equal(Utilities.ReadFileContent(t.OutputResources[0].ItemSpec), 268Utilities.ReadFileContent(t2b.OutputResources[0].ItemSpec)); 269Utilities.AssertLogContainsResource(t2b, "GenerateResource.ProcessingFile", t2b.Sources[0].ItemSpec, t2b.OutputResources[0].ItemSpec); 270Utilities.AssertLogContainsResource(t2b, "GenerateResource.ReadResourceMessage", 4, t2b.Sources[0].ItemSpec); 292string resourcesFile = Utilities.CreateBasicResourcesFile(false, _output); 294GenerateResource t = Utilities.CreateTask(_output); 300Utilities.ExecuteTask(t); 304Assert.Equal(Utilities.GetTestTextContent(null, null, true /*cleaned up */), Utilities.ReadFileContent(resourcesFile)); 305Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", t.Sources[0].ItemSpec, outputFile); 306Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, t.Sources[0].ItemSpec); 325string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").Path); 327GenerateResource t = Utilities.CreateTask(_output); 331Utilities.ExecuteTask(t); 349Utilities.AssertLogContainsResource(t, "GenerateResource.OutputDoesntExist", t.OutputResources[0].ItemSpec); 351Utilities.AssertStateFileWasWritten(t); 353GenerateResource t2 = Utilities.CreateTask(_output); 360Utilities.ExecuteTask(t2); 364Utilities.AssertLogContainsResource(t2, "GenerateResource.InputNewer", t2.Sources[0].ItemSpec, t2.OutputResources[0].ItemSpec); 371string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").Path); 373GenerateResource t = Utilities.CreateTask(_output); 377Utilities.ExecuteTask(t); 379Utilities.AssertLogContainsResource(t, "GenerateResource.OutputDoesntExist", t.OutputResources[0].ItemSpec); 381GenerateResource t2 = Utilities.CreateTask(_output); 390Utilities.AssertLogContainsResource(t2, "GenerateResource.ResourceNotFound", t2.Sources[0].ItemSpec); 397[MemberData(nameof(Utilities.UsePreserializedResourceStates), MemberType = typeof(Utilities))] 400string bitmap = Utilities.CreateWorldsSmallestBitmap(); 401string resxFile = Utilities.WriteTestResX(false, bitmap, null, false); 403GenerateResource t = Utilities.CreateTask(_output, usePreserialized, _env); 404t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 410Utilities.ExecuteTask(t); 415Utilities.AssertStateFileWasWritten(t); 417GenerateResource t2 = Utilities.CreateTask(_output, usePreserialized, _env); 425Utilities.ExecuteTask(t2); 429Utilities.AssertLogContainsResource( 455string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").Path); 460GenerateResource t1 = Utilities.CreateTask(_output); 463Utilities.ExecuteTask(t1); 465Utilities.AssertLogContainsResource(t1, "GenerateResource.OutputDoesntExist", t1.OutputResources[0].ItemSpec); 470GenerateResource t2 = Utilities.CreateTask(_output); 474Utilities.ExecuteTask(t2); 477GenerateResource t3 = Utilities.CreateTask(_output); 487Utilities.AssertLogContainsResource(t3, "GenerateResource.ProcessingFile", sources[0].ItemSpec, output[0].ItemSpec); 489GenerateResource t4 = Utilities.CreateTask(_output); 492Utilities.ExecuteTask(t4); 494Utilities.AssertLogContainsResource(t4, "GenerateResource.OutputDoesntExist", t4.OutputResources[0].ItemSpec); 497GenerateResource t5 = Utilities.CreateTask(_output); 501Utilities.ExecuteTask(t5); 512string bitmap = Utilities.CreateWorldsSmallestBitmap(); 514string resxFile = Utilities.WriteTestResX( 520GenerateResource t = Utilities.CreateTask( 546Utilities.AssertLogNotContainsResource(t, "GenerateResource.PreserializedResourcesRequiresProperty"); 550Utilities.AssertLogContainsResource(t, "GenerateResource.PreserializedResourcesRequiresProperty"); 555Utilities.AssertLogNotContainsResource(t, "GenerateResource.PreserializedResourcesRequiresExtensions"); 559Utilities.AssertLogContainsResource(t, "GenerateResource.PreserializedResourcesRequiresExtensions"); 560Utilities.AssertLogContainsResource(t, "GenerateResource.CorruptOutput", outputResource); 583string resxFile = Utilities.WriteTestResX( 589GenerateResource t = Utilities.CreateTask( 601Utilities.AssertLogNotContainsResource(t, "GenerateResource.PreserializedResourcesRequiresProperty"); 602Utilities.AssertLogNotContainsResource(t, "GenerateResource.PreserializedResourcesRequiresExtensions"); 616[MemberData(nameof(Utilities.UsePreserializedResourceStates), MemberType = typeof(Utilities))] 619string bitmap = Utilities.CreateWorldsSmallestBitmap(); 620string resxFile = Utilities.WriteTestResX(false, bitmap, null, false); 622GenerateResource t = Utilities.CreateTask(_output, usePreserialized, _env); 623t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 631Utilities.ExecuteTask(t); 636Utilities.AssertStateFileWasWritten(t); 638GenerateResource t2 = Utilities.CreateTask(_output, usePreserialized, _env); 648Utilities.AssertLogContainsResource( 677var firstResx = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").Path); 678var secondResx = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").Path); 681GenerateResource createResources = Utilities.CreateTask(_output); 686Utilities.ExecuteTask(createResources); 693GenerateResource t2 = Utilities.CreateTask(_output); 711Utilities.ExecuteTask(t2); 723Utilities.AssertLogContainsResource(t2, "GenerateResource.InputNewer", firstResx, t2.OutputResources[0].ItemSpec); 730[MemberData(nameof(Utilities.UsePreserializedResourceStates), MemberType = typeof(Utilities))] 733string bitmap = Utilities.CreateWorldsSmallestBitmap(); 734string resxFile = Utilities.WriteTestResX(false, bitmap, null, false); 736GenerateResource t = Utilities.CreateTask(_output, usePreserialized, _env); 737t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 745Utilities.ExecuteTask(t); 752Utilities.AssertStateFileWasWritten(t); 756GenerateResource t2 = Utilities.CreateTask(_output, usePreserialized, _env); 762Utilities.ExecuteTask(t2); 794resxFile = Utilities.WriteTestResX(false, null, null); 795txtFile = Utilities.WriteTestText(null, null); 797GenerateResource t = Utilities.CreateTask(_output); 798t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 803Utilities.ExecuteTask(t); 810Utilities.AssertStateFileWasWritten(t); 813GenerateResource t2 = Utilities.CreateTask(_output); 821Utilities.ExecuteTask(t2); 829Utilities.AssertStateFileWasWritten(t2); 872string stateFile = Utilities.GetTempFileName(".cache"); 873string localSystemDll = Utilities.GetPathToCopiedSystemDLL(); 877resxFile = Utilities.WriteTestResX(true /* uses system type */, null, null); 881GenerateResource initialCreator = Utilities.CreateTask(_output); 885Utilities.ExecuteTask(initialCreator); 891GenerateResource incrementalUpToDate = Utilities.CreateTask(_output); 895Utilities.ExecuteTask(incrementalUpToDate); 903GenerateResource incrementalOutOfDate = Utilities.CreateTask(_output); 915Utilities.ExecuteTask(incrementalOutOfDate); 921Utilities.AssertLogContainsResource(incrementalOutOfDate, "GenerateResource.InputNewer", localSystemDll, incrementalOutOfDate.OutputResources[0].ItemSpec); 959resxFile = Utilities.WriteTestResX(false, null, null); 970GenerateResource t = Utilities.CreateTask(_output); 973t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 974Utilities.ExecuteTask(t); 977GenerateResource t2 = Utilities.CreateTask(_output); 981Utilities.ExecuteTask(t2); 982Utilities.AssertLogContainsResource(t2, "GenerateResource.NothingOutOfDate", ""); 987GenerateResource t3 = Utilities.CreateTask(_output); 991Utilities.ExecuteTask(t3); 992Utilities.AssertLogNotContainsResource(t3, "GenerateResource.NothingOutOfDate", ""); 993Utilities.AssertLogContainsResource(t3, "GenerateResource.InputNewer", additionalInputs[1].ItemSpec, t3.OutputResources[0].ItemSpec); 1030GenerateResource t = Utilities.CreateTask(_output); 1032t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1034string textFile = Utilities.WriteTestText(null, null); 1038Utilities.ExecuteTask(t); 1043Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 1044Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 1064string resourcesFile = Utilities.CreateBasicResourcesFile(true, _output); 1067GenerateResource t = Utilities.CreateTask(_output); 1070Utilities.ExecuteTask(t); 1074GenerateResource t2a = Utilities.CreateTask(_output); 1077Utilities.ExecuteTask(t2a); 1081GenerateResource t2b = Utilities.CreateTask(_output); 1083t2b.OutputResources = new ITaskItem[] { new TaskItem(Utilities.GetTempFileName(".resx")) }; 1085Utilities.ExecuteTask(t2b); 1089Assert.Equal(Utilities.ReadFileContent(t.OutputResources[0].ItemSpec), 1090Utilities.ReadFileContent(t2b.OutputResources[0].ItemSpec)); 1112string textFile = Utilities.WriteTestText(null, null); 1115GenerateResource t = Utilities.CreateTask(_output); 1118Utilities.ExecuteTask(t); 1125GenerateResource t2 = Utilities.CreateTask(_output); 1128string outputFile = Utilities.GetTempFileName(".txt"); 1130Utilities.ExecuteTask(t2); 1135Assert.Equal(Utilities.GetTestTextContent(null, null, true /*cleaned up */), Utilities.ReadFileContent(resourcesFile)); 1157GenerateResource t = Utilities.CreateTask(_output); 1160string textFile = Utilities.WriteTestText(null, null); 1163t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1165Utilities.ExecuteTask(t); 1174Utilities.AssertStateFileWasWritten(t); 1180Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 1181Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 1195Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", stronglyTypedFileName); 1218GenerateResource t = Utilities.CreateTask(_output); 1219GenerateResource t2 = Utilities.CreateTask(_output); 1222string textFile = Utilities.WriteTestText(null, null); 1226t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1228Utilities.ExecuteTask(t); 1238Utilities.AssertStateFileWasWritten(t); 1244Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 1245Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 1259Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", stronglyTypedFileName); 1267Utilities.ExecuteTask(t2); 1272Utilities.AssertStateFileWasWritten(t2); 1308GenerateResource t = Utilities.CreateTask(_output); 1309resxFile = Utilities.WriteTestResX(false, null, null); 1310resourcesFile = Utilities.GetTempFileName(".resources"); 1312string stateFile = Utilities.GetTempFileName(".cache"); 1320Utilities.ExecuteTask(t); 1334Utilities.MoveBackTimestamp(resxFile, 1); 1335DateTime strTime = Utilities.MoveBackTimestamp(strFile, 1); 1336t = Utilities.CreateTask(_output); 1341Utilities.ExecuteTask(t); 1342Utilities.AssertLogContainsResource(t, "GenerateResource.NothingOutOfDate", ""); 1343Assert.False(Utilities.FileUpdated(strFile, strTime)); // Was not updated 1349t = Utilities.CreateTask(_output); 1354Utilities.ExecuteTask(t); 1355Assert.True(Utilities.FileUpdated(strFile, strTime)); // Was updated 1366t = Utilities.CreateTask(_output); 1371Utilities.ExecuteTask(t); 1405GenerateResource t = Utilities.CreateTask(_output); 1407txtFile = Utilities.WriteTestText(null, null); 1413Utilities.ExecuteTask(t); 1428Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", txtFile, t.OutputResources[0].ItemSpec); 1429Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, txtFile); 1438Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", strFile); 1465GenerateResource t = Utilities.CreateTask(_output); 1468string textFile = Utilities.WriteTestText(null, null); 1471t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1473Utilities.ExecuteTask(t); 1484Utilities.AssertStateFileWasWritten(t); 1487Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 1488Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 1502Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", stronglyTypedFileName); 1525GenerateResource t = Utilities.CreateTask(_output); 1528string textFile = Utilities.WriteTestText(null, null); 1531t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1533Utilities.ExecuteTask(t); 1540Utilities.AssertStateFileWasWritten(t); 1550Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 1551Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 1552Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", t.StronglyTypedFileName); 1581string bitmap = Utilities.CreateWorldsSmallestBitmap(); 1582string resxFile = Utilities.WriteTestResX(false, bitmap, null, false); 1584GenerateResource t = Utilities.CreateTask(_output); 1589t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1591Utilities.ExecuteTask(t); 1598Utilities.AssertStateFileWasWritten(t); 1608Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", resxFile, resourcesFile); 1609Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 2, resxFile); 1610Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", t.StronglyTypedFileName); 1641Utilities.STRNamespaceTestHelper("CSharp", "MyResourcesNamespace", null, _output); 1650Utilities.STRNamespaceTestHelper("VB", "MyResourcesNamespace", null, _output); 1659Utilities.STRNamespaceTestHelper("CSharp", "MyResourcesNamespace", "MySTClassNamespace", _output); 1668Utilities.STRNamespaceTestHelper("VB", "MyResourcesNamespace", "MySTClassNamespace", _output); 1710t = Utilities.CreateTask(_output); 1712textFile = Utilities.WriteTestText(null, test[0]); 1715Utilities.AssertLogContains(t, test[1]); 1726t = Utilities.CreateTask(_output); 1728textFile = Utilities.WriteTestText(null, "[strings]"); 1734Utilities.AssertLogContains(t, "MSB3562"); 1757GenerateResource t = Utilities.CreateTask(_output); 1758t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1761resxFile1 = Utilities.WriteTestResX(false, null, " <data name='ack!'>>>>>>\xd\xa <valueAB>Assembly</value>\xd\xa </data>\xd\xa", false); 1763resxFile2 = Utilities.WriteTestResX(false, null, null); 1784Utilities.AssertStateFileWasWritten(t); 1795Utilities.AssertLogContains(t, "MSB3103"); 1834GenerateResource t = Utilities.CreateTask(_output); 1835t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1838resxFile1 = Utilities.WriteTestResX(false, null, " <data name='ack!'>>>>>>\xd\xa <valueAB>Assembly</value>\xd\xa </data>\xd\xa", false); 1840resxFile2 = Utilities.WriteTestResX(false, null, null); 1863Utilities.AssertStateFileWasWritten(t); 1874Utilities.AssertLogContains(t, "MSB3103"); 1877Utilities.AssertLogContains(t, "valueAB"); 1878Utilities.AssertLogContains(t, "value"); 1910GenerateResource t = Utilities.CreateTask(_output); 1912string textFile = Utilities.WriteTestText(null, "Marley=some guy from Jamaica"); 1919Utilities.AssertLogContains(t, "MSB3568"); 1935string bitmap = Utilities.CreateWorldsSmallestBitmap(); 1936string resxFile = Utilities.WriteTestResX(false, bitmap, null, false); 1938GenerateResource t = Utilities.CreateTask(_output); 1939t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 1946Utilities.AssertLogContains(t, "MSB3556"); 1968GenerateResource t = Utilities.CreateTask(_output); 1969resxFile = Utilities.WriteTestResX(false, null, null); 1980Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", resxFile, resourcesFile); 1981Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 1, resxFile); 2030GenerateResource gr = Utilities.CreateTask(_output, usePreserialized: true, env: env); 2036Utilities.AssertLogContainsResource(gr, "GenerateResource.BinaryFormatterUse", "$this.Icon", "System.Drawing.Icon, System.Drawing"); 2045GenerateResource t = Utilities.CreateTask(_output); 2046t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2050string resxFile = Utilities.WriteTestResX(false, null, null); 2061Utilities.AssertLogContains(t, "MSB3103"); 2078GenerateResource t = Utilities.CreateTask(_output); 2089Utilities.AssertLogContains(t, "MSB3824"); 2098GenerateResource t = Utilities.CreateTask(_output); 2099t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2101string textFile = Utilities.WriteTestText(null, "object=some string"); 2113Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 2114Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 5, textFile); 2115Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", t.StronglyTypedFileName); 2116Utilities.AssertLogContains(t, "MSB3570"); 2117Utilities.AssertLogContains(t, t.StronglyTypedFileName); 2138GenerateResource t = Utilities.CreateTask(_output); 2141txtFile = Utilities.WriteTestResX(false, null, null, true /*data with invalid type*/); 2185GenerateResource t = Utilities.CreateTask(_output); 2187string resxFile = Utilities.WriteTestResX(false, null, null); 2197Utilities.ExecuteTask(t); 2223GenerateResource t = Utilities.CreateTask(_output); 2225string resxFile = Utilities.WriteTestResX(false, null, null); 2230Utilities.ExecuteTask(t); 2253GenerateResource t = Utilities.CreateTask(_output); 2256new TaskItem( Utilities.WriteTestResX(false, null, null)), 2257new TaskItem( Utilities.WriteTestResX(false, null, null)), 2258new TaskItem( Utilities.WriteTestResX(false, null, null)), 2259new TaskItem( Utilities.WriteTestResX(false, null, null)), 2262Utilities.ExecuteTask(t); 2289GenerateResource t = Utilities.CreateTask(_output); 2292new TaskItem( Utilities.WriteTestResX(false, null, null)), 2293new TaskItem( Utilities.WriteTestResX(false, null, null)), 2294new TaskItem( Utilities.WriteTestResX(false, null, null)), 2295new TaskItem( Utilities.WriteTestResX(false, null, null)), 2298t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2300Utilities.ExecuteTask(t); 2311Utilities.AssertStateFileWasWritten(t); 2331GenerateResource t = Utilities.CreateTask(_output); 2336new TaskItem( Utilities.WriteTestText(null, null)), 2337new TaskItem( Utilities.WriteTestText(null, null)), 2338new TaskItem( Utilities.WriteTestText("goober", null)), 2339new TaskItem( Utilities.WriteTestText(null, null)), 2347t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2383Utilities.AssertStateFileWasWritten(t); 2387Utilities.AssertLogContains(t, "MSB3563"); 2388Utilities.AssertLogContains(t, "[goober]"); 2414GenerateResource t = Utilities.CreateTask(_output); 2418t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2420string textFile = Utilities.WriteTestText(null, null); 2427Utilities.ExecuteTask(t); 2429Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, t.OutputResources[0].ItemSpec); 2430Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 2431Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", t.StronglyTypedFileName); 2436Utilities.AssertStateFileWasWritten(t); 2459GenerateResource t = Utilities.CreateTask(_output); 2463string textFile = Utilities.WriteTestText(null, null); 2467t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2469Utilities.ExecuteTask(t); 2471Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, t.OutputResources[0].ItemSpec); 2472Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 2473Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", t.StronglyTypedFileName); 2478Utilities.AssertStateFileWasWritten(t); 2520GenerateResource t = Utilities.CreateTask(_output); 2521Utilities.ExecuteTask(t); 2522Utilities.AssertLogContainsResource(t, "GenerateResource.NoSources", ""); 2541GenerateResource t = Utilities.CreateTask(_output); 2546textFile = Utilities.WriteTestText(null, null); 2575GenerateResource t = Utilities.CreateTask(_output); 2576txtFile = Utilities.WriteTestText(null, null); 2585Utilities.AssertLogContains(t, "MSB3552"); 2612GenerateResource t = Utilities.CreateTask(_output); 2615string textFile = Utilities.WriteTestText(null, null); 2622Utilities.AssertLogContainsResourceWithUnspecifiedReplacements(t, "General.CouldNotReadStateFileMessage"); 2624Utilities.AssertLogContains(t, "MSB3101"); 2650GenerateResource t = Utilities.CreateTask(_output); 2652string textFile = Utilities.WriteTestText(null, null); 2660Utilities.AssertLogContains(t, "MSB3558"); 2661Utilities.AssertLogNotContainsResource(t, "GenerateResource.ReadResourceMessage", 4, newTextFile); 2683GenerateResource t = Utilities.CreateTask(_output); 2685string textFile = Utilities.WriteTestText(null, null); 2693Utilities.AssertLogContains(t, "MSB3558"); 2715GenerateResource t = Utilities.CreateTask(_output); 2717string textFile = Utilities.WriteTestText(null, null); 2725Utilities.AssertLogContains(t, "MSB3094"); 2747GenerateResource t = Utilities.CreateTask(_output); 2748t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2750string textFile = Utilities.WriteTestText(null, null); 2757Utilities.AssertLogContains(t, "MSB3559"); 2784resxFile = Utilities.WriteTestResX(false, null, null); 2785resxFile2 = Utilities.WriteTestResX(false, null, null); 2787GenerateResource t = Utilities.CreateTask(_output); 2794Utilities.AssertLogContains(t, "MSB3573"); 2833GenerateResource t = Utilities.CreateTask(_output); 2834t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 2836txtFile = Utilities.WriteTestText(null, null); 2848Utilities.AssertLogContains(t, "MSB3570"); 2873GenerateResource t = Utilities.CreateTask(_output); 2874txtFile = Utilities.WriteTestText(null, null); 2885Utilities.AssertLogContainsResource(t, "GenerateResource.STRClassNamespaceOrFilenameWithoutLanguage"); 2910GenerateResource t = Utilities.CreateTask(_output); 2911txtFile = Utilities.WriteTestText(null, null); 2922Utilities.AssertLogContainsResource(t, "GenerateResource.STRClassNamespaceOrFilenameWithoutLanguage"); 2947GenerateResource t = Utilities.CreateTask(_output); 2948txtFile = Utilities.WriteTestText(null, null); 2959Utilities.AssertLogContainsResource(t, "GenerateResource.STRClassNamespaceOrFilenameWithoutLanguage"); 2986GenerateResource t = Utilities.CreateTask(_output); 2987txtFile = Utilities.WriteTestText(null, null); 3002Utilities.AssertLogContains(t, "MSB3570"); 3003Utilities.AssertLogContains(t, t.StronglyTypedClassName); 3036GenerateResource t = Utilities.CreateTask(_output); 3037resourcesFile = Utilities.WriteTestResX(false, null, null); 3046Utilities.AssertLogContains(t, "MSB3553"); 3212GenerateResource t = Utilities.CreateTask(_output); 3361GenerateResource t = Utilities.CreateTask(_output); 3410string resxFile = Utilities.WriteTestResX(false, null, null); 3416GenerateResource t = Utilities.CreateTask(_output); 3435Utilities.AssertLogContains( 3446resxFile = Utilities.WriteTestResX(false, null, null); 3452GenerateResource t = Utilities.CreateTask(_output); 3474Utilities.AssertLogContains( 3489resxFile = Utilities.WriteTestResX(false, null, null); 3495GenerateResource t = Utilities.CreateTask(_output); 3518Utilities.AssertLogContains( 3532resxFile = Utilities.WriteTestResX(false, null, null); 3535string resxFile1 = Utilities.WriteTestResX(false, null, null); 3541GenerateResource t = Utilities.CreateTask(_output); 3576Utilities.AssertLogContains(t, 3621GenerateResource t = Utilities.CreateTask(_output); 3622t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 3626string resxFile = Utilities.WriteTestResX(false, null, data); 3629Utilities.ExecuteTask(t); 3679Utilities.WriteTestResX(false, null, fileRef, false, resxFile); 3683GenerateResource task = Utilities.CreateTask(_output); 3686Utilities.ExecuteTask(task); 3707Utilities.FileUpdated(resourcesFile, initialWriteTime).ShouldBeFalse(); 3864Utilities.ExecuteTask(t); 4005string textFile = Utilities.GetTempFileName(".txt"); 4136string tempSystemDLL = Utilities.GetTempFileName(".dll"); 4155string smallestBitmapFile = Utilities.GetTempFileName(".bmp"); 4207GenerateResource t = Utilities.CreateTask(output); 4210t.StateFile = new TaskItem(Utilities.GetTempFileName(".cache")); 4212string textFile = Utilities.WriteTestText(null, null); 4234Utilities.ExecuteTask(t); 4253Utilities.AssertStateFileWasWritten(t); 4265Assert.Contains("ResourceManager(\"" + resourcesNamespace + "." + t.StronglyTypedClassName, Utilities.ReadFileContent(STRFile)); 4267Assert.Contains("class " + Path.GetFileNameWithoutExtension(textFile).ToLower(), Utilities.ReadFileContent(STRFile).ToLower()); 4270Assert.DoesNotContain("namespace " + resourcesNamespace.ToLower(), Utilities.ReadFileContent(STRFile).ToLower()); 4273Assert.Contains("namespace " + classNamespace.ToLower(), Utilities.ReadFileContent(STRFile).ToLower()); 4277Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, resourcesFile); 4278Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, textFile); 4292Utilities.AssertLogContainsResource(t, "GenerateResource.CreatingSTR", t.StronglyTypedFileName);
ResourceHandling\MSBuildResXReader_Tests.cs (1)
270string bitmapPath = Build.UnitTests.GenerateResource_Tests.Utilities.CreateWorldsSmallestBitmap();