|
13 | 13 | // ----------------------------------------------------------------------------------
|
14 | 14 |
|
15 | 15 | using System;
|
| 16 | +using System.Globalization; |
16 | 17 | using System.Collections.Generic;
|
17 | 18 | using System.Diagnostics;
|
18 |
| -using System.Runtime.InteropServices; |
19 | 19 | using System.Xml;
|
20 | 20 | using Microsoft.Azure.ServiceManagement.Common.Models;
|
21 | 21 | using Microsoft.WindowsAzure.Commands.ScenarioTest;
|
@@ -51,10 +51,10 @@ public void CustomPrinterTest_SimpleTypes()
|
51 | 51 | Assert.Equal(" : " + XmlConvert.ToString(ts) + Environment.NewLine, OutputClasses.CustomPrinter.Print(ts));
|
52 | 52 |
|
53 | 53 | // Must be dt.ToUniversalTime().ToString("O") in the future
|
54 |
| - Assert.Equal(" : " + dt + Environment.NewLine, OutputClasses.CustomPrinter.Print(dt)); |
| 54 | + Assert.Equal(" : " + dt.ToString(CultureInfo.InvariantCulture) + Environment.NewLine, OutputClasses.CustomPrinter.Print(dt)); |
55 | 55 |
|
56 | 56 | // Must be dtUtc.ToString("O") in the future
|
57 |
| - Assert.Equal(" : " + dtUtc + Environment.NewLine, OutputClasses.CustomPrinter.Print(dtUtc)); |
| 57 | + Assert.Equal(" : " + dtUtc.ToString(CultureInfo.InvariantCulture) + Environment.NewLine, OutputClasses.CustomPrinter.Print(dtUtc)); |
58 | 58 |
|
59 | 59 | // Both must be string.Empty in the future
|
60 | 60 | Assert.Equal($" :{Environment.NewLine}", OutputClasses.CustomPrinter.Print(null));
|
@@ -87,7 +87,7 @@ public void CustomPrinterTest_ComplexTypes()
|
87 | 87 |
|
88 | 88 | // Must be [\r\nAuthorization : [\r\n Action : PUT\r\n Role : Sender\r\n Scope : None\r\n ]\r\nClaims : {\r\n [aud, https://management.core.windows.net/]\r\n [iss, https://sts.windows.net/123456/]\r\n [iat, h123445]\r\n }\r\nCaller : caller\r\nDescription : fake event\r\nId : ac7d2ab5-698a-4c33-9c19-0a93d3d7f527\r\nEventDataId : \r\nCorrelationId : correlation\r\nEventName : [\r\n Value : Start request\r\n LocalizedValue : Start request\r\n ]\r\nCategory : [\r\n Value : Microsoft Resources\r\n LocalizedValue : Microsoft Resources\r\n ]\r\nHttpRequest : [\r\n ClientRequestId : 1234\r\n ClientIpAddress : 123.123.123.123\r\n Method : PUT\r\n Uri : http://path/subscriptions/ffce8037-a374-48bf-901d-dac4e3ea8c09/resourcegroups/foo/deployments/testdeploy\r\n ]\r\nLevel : Informational\r\nResourceGroupName : Default-Web-EastUS\r\nResourceProviderName : [\r\n Value : Microsoft Resources\r\n LocalizedValue : Microsoft Resources\r\n ]\r\nResourceId : /subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/garyyang1\r\nResourceType : \r\nOperationId : c0f2e85f-efb0-47d0-bf90-f983ec8be91d\r\nOperationName : [\r\n Value : Microsoft.Resources/subscriptions/resourcegroups/deployments/write\r\n LocalizedValue : Microsoft.Resources/subscriptions/resourcegroups/deployments/write\r\n ]\r\nProperties : {}\r\nStatus : [\r\n Value : Succeeded\r\n LocalizedValue : Succeeded\r\n ]\r\nSubStatus : [\r\n Value : Created\r\n LocalizedValue : Created\r\n ]\r\nEventTimestamp : 2017-06-07T22:54:00.0000000Z\r\nSubmissionTimestamp : 2017-06-07T22:54:00.0000000Z\r\nSubscriptionId : \r\nTenantId : \r\n] in the future
|
89 | 89 | Assert.Equal(
|
90 |
| - expected: $"Authorization {Environment.NewLine}Action : PUT{Environment.NewLine}Role : Sender{Environment.NewLine}Scope : None{Environment.NewLine}{Environment.NewLine}Claims {Environment.NewLine} : [aud, https://management.core.windows.net/]{Environment.NewLine} : [iss, https://sts.windows.net/123456/]{Environment.NewLine} : [iat, h123445]{Environment.NewLine}Caller : caller{Environment.NewLine}Description : fake event{Environment.NewLine}Id : ac7d2ab5-698a-4c33-9c19-0a93d3d7f527{Environment.NewLine}EventDataId :{Environment.NewLine}CorrelationId : correlation{Environment.NewLine}EventName {Environment.NewLine}Value : Start request{Environment.NewLine}LocalizedValue : Start request{Environment.NewLine}{Environment.NewLine}Category {Environment.NewLine}Value : Microsoft Resources{Environment.NewLine}LocalizedValue : Microsoft Resources{Environment.NewLine}{Environment.NewLine}HttpRequest {Environment.NewLine}ClientRequestId : 1234{Environment.NewLine}ClientIpAddress : 123.123.123.123{Environment.NewLine}Method : PUT{Environment.NewLine}Uri : http://path/subscriptions/ffce8037-a374-48bf-901d-dac4e3ea8c09/resourcegroups/foo/deployments/testdeploy{Environment.NewLine}{Environment.NewLine}Level : Informational{Environment.NewLine}ResourceGroupName : Default-Web-EastUS{Environment.NewLine}ResourceProviderName{Environment.NewLine}Value : Microsoft Resources{Environment.NewLine}LocalizedValue : Microsoft Resources{Environment.NewLine}{Environment.NewLine}ResourceId : /subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/garyyang1{Environment.NewLine}ResourceType :{Environment.NewLine}OperationId : c0f2e85f-efb0-47d0-bf90-f983ec8be91d{Environment.NewLine}OperationName {Environment.NewLine}Value : Microsoft.Resources/subscriptions/resourcegroups/deployments/write{Environment.NewLine}LocalizedValue : Microsoft.Resources/subscriptions/resourcegroups/deployments/write{Environment.NewLine}{Environment.NewLine}Properties {Environment.NewLine}Status {Environment.NewLine}Value : Succeeded{Environment.NewLine}LocalizedValue : Succeeded{Environment.NewLine}{Environment.NewLine}SubStatus {Environment.NewLine}Value : Created{Environment.NewLine}LocalizedValue : Created{Environment.NewLine}{Environment.NewLine}EventTimestamp : 6/7/{year} 10:54:00 PM{Environment.NewLine}SubmissionTimestamp : 6/7/{year} 10:54:00 PM{Environment.NewLine}SubscriptionId :{Environment.NewLine}TenantId :{Environment.NewLine}{Environment.NewLine}", |
| 90 | + expected: $"Authorization {Environment.NewLine}Action : PUT{Environment.NewLine}Role : Sender{Environment.NewLine}Scope : None{Environment.NewLine}{Environment.NewLine}Claims {Environment.NewLine} : [aud, https://management.core.windows.net/]{Environment.NewLine} : [iss, https://sts.windows.net/123456/]{Environment.NewLine} : [iat, h123445]{Environment.NewLine}Caller : caller{Environment.NewLine}Description : fake event{Environment.NewLine}Id : ac7d2ab5-698a-4c33-9c19-0a93d3d7f527{Environment.NewLine}EventDataId :{Environment.NewLine}CorrelationId : correlation{Environment.NewLine}EventName {Environment.NewLine}Value : Start request{Environment.NewLine}LocalizedValue : Start request{Environment.NewLine}{Environment.NewLine}Category {Environment.NewLine}Value : Microsoft Resources{Environment.NewLine}LocalizedValue : Microsoft Resources{Environment.NewLine}{Environment.NewLine}HttpRequest {Environment.NewLine}ClientRequestId : 1234{Environment.NewLine}ClientIpAddress : 123.123.123.123{Environment.NewLine}Method : PUT{Environment.NewLine}Uri : http://path/subscriptions/ffce8037-a374-48bf-901d-dac4e3ea8c09/resourcegroups/foo/deployments/testdeploy{Environment.NewLine}{Environment.NewLine}Level : Informational{Environment.NewLine}ResourceGroupName : Default-Web-EastUS{Environment.NewLine}ResourceProviderName{Environment.NewLine}Value : Microsoft Resources{Environment.NewLine}LocalizedValue : Microsoft Resources{Environment.NewLine}{Environment.NewLine}ResourceId : /subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/garyyang1{Environment.NewLine}ResourceType :{Environment.NewLine}OperationId : c0f2e85f-efb0-47d0-bf90-f983ec8be91d{Environment.NewLine}OperationName {Environment.NewLine}Value : Microsoft.Resources/subscriptions/resourcegroups/deployments/write{Environment.NewLine}LocalizedValue : Microsoft.Resources/subscriptions/resourcegroups/deployments/write{Environment.NewLine}{Environment.NewLine}Properties {Environment.NewLine}Status {Environment.NewLine}Value : Succeeded{Environment.NewLine}LocalizedValue : Succeeded{Environment.NewLine}{Environment.NewLine}SubStatus {Environment.NewLine}Value : Created{Environment.NewLine}LocalizedValue : Created{Environment.NewLine}{Environment.NewLine}EventTimestamp : 06/07/{year} 22:54:00{Environment.NewLine}SubmissionTimestamp : 06/07/{year} 22:54:00{Environment.NewLine}SubscriptionId :{Environment.NewLine}TenantId :{Environment.NewLine}{Environment.NewLine}", |
91 | 91 | actual: result);
|
92 | 92 |
|
93 | 93 | dictionarySS.Add("k1", "v1");
|
|
0 commit comments