File tree 2 files changed +36
-0
lines changed
System.Private.ServiceModel/tests/Common/Infrastructure/xunit
System.ServiceModel.Primitives/tests/ServiceModel
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+ // See the LICENSE file in the project root for more information.
4
+
5
+ using System ;
6
+ using System . Globalization ;
7
+ using System . Reflection ;
8
+ using Xunit . Sdk ;
9
+
10
+ namespace Infrastructure . Common
11
+ {
12
+ [ AttributeUsage ( AttributeTargets . Method | AttributeTargets . Class , AllowMultiple = true , Inherited = true ) ]
13
+ public class WcfCurrentCultureAttribute : BeforeAfterTestAttribute
14
+ {
15
+ private readonly CultureInfo _cultureInfo ;
16
+ private CultureInfo _savedCultureInfo ;
17
+
18
+ public WcfCurrentCultureAttribute ( string name )
19
+ {
20
+ _cultureInfo = new CultureInfo ( name ) ;
21
+ }
22
+
23
+ public override void Before ( MethodInfo methodUnderTest )
24
+ {
25
+ _savedCultureInfo = CultureInfo . CurrentCulture ;
26
+ CultureInfo . CurrentCulture = _cultureInfo ;
27
+ }
28
+
29
+ public override void After ( MethodInfo methodUnderTest )
30
+ {
31
+ CultureInfo . CurrentCulture = _savedCultureInfo ;
32
+ }
33
+ }
34
+ }
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public static void Ctor_TDetail_FaultReason()
36
36
}
37
37
38
38
[ WcfFact ]
39
+ [ WcfCurrentCulture ( "en-US" ) ]
39
40
public static void Serializable_TDetail ( )
40
41
{
41
42
// This isn't exactly what NetFx generates as the HResult is different due to CommunicationException deriving from SystemException on NetFx
@@ -57,6 +58,7 @@ public static void Serializable_TDetail()
57
58
}
58
59
59
60
[ WcfFact ]
61
+ [ WcfCurrentCulture ( "en-US" ) ]
60
62
public static void Serializable_Default ( )
61
63
{
62
64
string netfxBsl = @"<FaultException xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:x=""http://www.w3.org/2001/XMLSchema""><ClassName i:type=""x:string"" xmlns="""">System.ServiceModel.FaultException</ClassName><Message i:type=""x:string"" xmlns="""">The creator of this fault did not specify a Reason.</Message><Data i:nil=""true"" xmlns=""""/><InnerException i:nil=""true"" xmlns=""""/><HelpURL i:nil=""true"" xmlns=""""/><StackTraceString i:nil=""true"" xmlns=""""/><RemoteStackTraceString i:nil=""true"" xmlns=""""/><RemoteStackIndex i:type=""x:int"" xmlns="""">0</RemoteStackIndex><ExceptionMethod i:nil=""true"" xmlns=""""/><HResult i:type=""x:int"" xmlns="""">-2146233088</HResult><Source i:nil=""true"" xmlns=""""/><WatsonBuckets i:nil=""true"" xmlns=""""/><code i:type=""a:ArrayOfFaultException.FaultCodeData"" xmlns="""" xmlns:a=""http://schemas.datacontract.org/2004/07/System.ServiceModel""><a:FaultException.FaultCodeData><a:name>Sender</a:name><a:ns/></a:FaultException.FaultCodeData></code><reason i:type=""a:ArrayOfFaultException.FaultReasonData"" xmlns="""" xmlns:a=""http://schemas.datacontract.org/2004/07/System.ServiceModel""><a:FaultException.FaultReasonData><a:text>The creator of this fault did not specify a Reason.</a:text><a:xmlLang>en-US</a:xmlLang></a:FaultException.FaultReasonData></reason><messageFault i:nil=""true"" xmlns=""""/><action i:nil=""true"" xmlns=""""/></FaultException>" ;
You can’t perform that action at this time.
0 commit comments