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