-
Notifications
You must be signed in to change notification settings - Fork 357
Expand file tree
/
Copy pathHttpErrorKeysTest.cs
More file actions
40 lines (36 loc) · 1.51 KB
/
HttpErrorKeysTest.cs
File metadata and controls
40 lines (36 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.TestCommon;
namespace System.Web.Http
{
public class HttpErrorKeysTest
{
public static TheoryDataSet<Func<string>, string> ErrorKeys
{
get
{
return new TheoryDataSet<Func<string>, string>
{
{ () => HttpErrorKeys.MessageKey, "Message" },
{ () => HttpErrorKeys.MessageDetailKey, "MessageDetail" },
{ () => HttpErrorKeys.ModelStateKey, "ModelState" },
{ () => HttpErrorKeys.ExceptionMessageKey, "ExceptionMessage" },
{ () => HttpErrorKeys.ExceptionTypeKey, "ExceptionType" },
{ () => HttpErrorKeys.StackTraceKey, "StackTrace" },
{ () => HttpErrorKeys.InnerExceptionKey, "InnerException" },
{ () => HttpErrorKeys.MessageLanguageKey, "MessageLanguage" },
{ () => HttpErrorKeys.ErrorCodeKey, "ErrorCode" }
};
}
}
[Theory]
[PropertyData("ErrorKeys")]
public void HttpErrorKeyProperties_Returns_CorrectKeys(Func<string> productUnderTest, string expectedResult)
{
// Act
string actualResult = productUnderTest.Invoke();
// Assert
Assert.Equal(expectedResult, actualResult);
}
}
}