Quellcode durchsuchen

Fix `Excepted` -> `Expected` typos in repo (#44989)

Tanay Parikh vor 3 Jahren
Ursprung
Commit
30a917145b

+ 4 - 4
src/Http/Http.Extensions/test/HttpRequestJsonExtensionsTests.cs

@@ -21,8 +21,8 @@ public class HttpRequestJsonExtensionsTests
         var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await context.Request.ReadFromJsonAsync<int>());
 
         // Assert
-        var exceptedMessage = $"Unable to read the request as JSON because the request content type 'text/json' is not a known JSON content type.";
-        Assert.Equal(exceptedMessage, ex.Message);
+        var expectedMessage = $"Unable to read the request as JSON because the request content type 'text/json' is not a known JSON content type.";
+        Assert.Equal(expectedMessage, ex.Message);
     }
 
     [Fact]
@@ -36,8 +36,8 @@ public class HttpRequestJsonExtensionsTests
         var ex = await Assert.ThrowsAsync<JsonException>(async () => await context.Request.ReadFromJsonAsync<int>());
 
         // Assert
-        var exceptedMessage = $"The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.";
-        Assert.Equal(exceptedMessage, ex.Message);
+        var expectedMessage = $"The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.";
+        Assert.Equal(expectedMessage, ex.Message);
     }
 
     [Fact]

+ 2 - 2
src/JSInterop/Microsoft.JSInterop/src/Implementation/JSObjectReferenceJsonWorker.cs

@@ -35,12 +35,12 @@ public static class JSObjectReferenceJsonWorker
                 }
                 else
                 {
-                    throw new JsonException($"Unexcepted JSON property {reader.GetString()}.");
+                    throw new JsonException($"Unexpected JSON property {reader.GetString()}.");
                 }
             }
             else
             {
-                throw new JsonException($"Unexcepted JSON token {reader.TokenType}");
+                throw new JsonException($"Unexpected JSON token {reader.TokenType}");
             }
         }
 

+ 2 - 2
src/JSInterop/Microsoft.JSInterop/src/Infrastructure/JSStreamReferenceJsonConverter.cs

@@ -42,12 +42,12 @@ internal sealed class JSStreamReferenceJsonConverter : JsonConverter<IJSStreamRe
                 }
                 else
                 {
-                    throw new JsonException($"Unexcepted JSON property {reader.GetString()}.");
+                    throw new JsonException($"Unexpected JSON property {reader.GetString()}.");
                 }
             }
             else
             {
-                throw new JsonException($"Unexcepted JSON token {reader.TokenType}");
+                throw new JsonException($"Unexpected JSON token {reader.TokenType}");
             }
         }
 

+ 1 - 1
src/JSInterop/Microsoft.JSInterop/test/Infrastructure/JSObjectReferenceJsonConverterTest.cs

@@ -36,7 +36,7 @@ public class JSObjectReferenceJsonConverterTest
 
         // Act & Assert
         var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSObjectReference>(json, JsonSerializerOptions));
-        Assert.Equal("Unexcepted JSON property foo.", ex.Message);
+        Assert.Equal("Unexpected JSON property foo.", ex.Message);
     }
 
     [Fact]

+ 1 - 1
src/JSInterop/Microsoft.JSInterop/test/Infrastructure/JSStreamReferenceJsonConverterTest.cs

@@ -36,7 +36,7 @@ public class JSStreamReferenceJsonConverterTest
 
         // Act & Assert
         var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSStreamReference>(json, JsonSerializerOptions));
-        Assert.Equal("Unexcepted JSON property foo.", ex.Message);
+        Assert.Equal("Unexpected JSON property foo.", ex.Message);
     }
 
     [Fact]

+ 28 - 28
src/Mvc/Mvc.Core/src/Resources.resx

@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <root>
-  <!-- 
-    Microsoft ResX Schema 
-    
+  <!--
+    Microsoft ResX Schema
+
     Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
     associated with the data types.
-    
+
     Example:
-    
+
     ... ado.net/XML headers & schema ...
     <resheader name="resmimetype">text/microsoft-resx</resheader>
     <resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
         <comment>This is a comment</comment>
     </data>
-                
-    There are any number of "resheader" rows that contain simple 
+
+    There are any number of "resheader" rows that contain simple
     name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
     mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
     extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
     read any of the formats listed below.
-    
+
     mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
-    
+
     mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
             : and then encoded with base64 encoding.
 
     mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
+    value   : The object must be serialized into a byte array
             : using a System.ComponentModel.TypeConverter
             : and then encoded with base64 encoding.
     -->
@@ -481,7 +481,7 @@
     <value>'{0}' reached the configured maximum size of the buffer when enumerating a value of type '{1}'. This limit is in place to prevent infinite streams of 'IAsyncEnumerable&lt;&gt;' from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit.</value>
   </data>
   <data name="UnexpectedJsonEnd" xml:space="preserve">
-    <value>Unexcepted end when reading JSON.</value>
+    <value>Unexpected end when reading JSON.</value>
   </data>
   <data name="FailedToReadRequestForm" xml:space="preserve">
     <value>Failed to read the request form. {0}</value>

+ 1 - 1
src/Mvc/test/Mvc.FunctionalTests/Infrastructure/HttpClientExtensions.cs

@@ -69,7 +69,7 @@ public static class HttpClientExtensions
         {
             get
             {
-                return $"Excepted status code {ExpectedStatusCode}. Actual {ActualStatusCode}. Response Content:" + Environment.NewLine + ResponseContent;
+                return $"Expected status code {ExpectedStatusCode}. Actual {ActualStatusCode}. Response Content:" + Environment.NewLine + ResponseContent;
             }
         }
     }

+ 2 - 2
src/Shared/ProblemDetails/HttpValidationProblemDetailsJsonConverter.cs

@@ -23,7 +23,7 @@ internal sealed class HttpValidationProblemDetailsJsonConverter : JsonConverter<
     {
         if (reader.TokenType != JsonTokenType.StartObject)
         {
-            throw new JsonException("Unexcepted end when reading JSON.");
+            throw new JsonException("Unexpected end when reading JSON.");
         }
 
         while (reader.Read() && reader.TokenType != JsonTokenType.EndObject)
@@ -47,7 +47,7 @@ internal sealed class HttpValidationProblemDetailsJsonConverter : JsonConverter<
 
         if (reader.TokenType != JsonTokenType.EndObject)
         {
-            throw new JsonException("Unexcepted end when reading JSON.");
+            throw new JsonException("Unexpected end when reading JSON.");
         }
 
         return problemDetails;

+ 2 - 2
src/Shared/ProblemDetails/ProblemDetailsJsonConverter.cs

@@ -23,7 +23,7 @@ internal sealed class ProblemDetailsJsonConverter : JsonConverter<ProblemDetails
 
         if (reader.TokenType != JsonTokenType.StartObject)
         {
-            throw new JsonException("Unexcepted end when reading JSON.");
+            throw new JsonException("Unexpected end when reading JSON.");
         }
 
         while (reader.Read() && reader.TokenType != JsonTokenType.EndObject)
@@ -33,7 +33,7 @@ internal sealed class ProblemDetailsJsonConverter : JsonConverter<ProblemDetails
 
         if (reader.TokenType != JsonTokenType.EndObject)
         {
-            throw new JsonException("Unexcepted end when reading JSON.");
+            throw new JsonException("Unexpected end when reading JSON.");
         }
 
         return problemDetails;