This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
forked from 18F/dol-whd-14c
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from AppliedIS/config-ssl
Config ssl
- Loading branch information
Showing
23 changed files
with
144 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
DOL.WHD.Section14c.Api/Providers/RestrictedMultipartMemoryStreamProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.ComponentModel; | ||
using System.Configuration; | ||
|
||
namespace DOL.WHD.Section14c.Common | ||
{ | ||
public static class AppSettings | ||
{ | ||
public static T Get<T>(string key) | ||
{ | ||
var appSetting = ConfigurationManager.AppSettings[key]; | ||
if (string.IsNullOrWhiteSpace(appSetting)) throw new SettingsPropertyNotFoundException(key); | ||
|
||
var converter = TypeDescriptor.GetConverter(typeof(T)); | ||
return (T)(converter.ConvertFromInvariantString(appSetting)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Configuration; | ||
using DOL.WHD.Section14c.Common; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace DOL.WHD.Section14c.Test.Common | ||
{ | ||
[TestClass] | ||
public class AppSettingsTests | ||
{ | ||
[TestMethod] | ||
[ExpectedException(typeof(SettingsPropertyNotFoundException))] | ||
|
||
public void SetttingNotAvailable() | ||
{ | ||
AppSettings.Get<bool>("unknown"); | ||
} | ||
|
||
[TestMethod] | ||
|
||
public void SetttingConfigured_ReturnsCorrectBool() | ||
{ | ||
var results = AppSettings.Get<bool>("BoolConfig"); | ||
Assert.AreEqual(results, true); | ||
} | ||
|
||
[TestMethod] | ||
|
||
public void SetttingConfigured_ReturnsInt() | ||
{ | ||
var results = AppSettings.Get<int>("IntConfig"); | ||
Assert.AreEqual(results, 1); | ||
} | ||
|
||
[TestMethod] | ||
|
||
public void SetttingConfigured_ReturnsString() | ||
{ | ||
var results = AppSettings.Get<string>("StringConfig"); | ||
Assert.AreEqual(results, "value"); | ||
} | ||
|
||
[TestMethod] | ||
|
||
public void SetttingConfigured_ReturnsDouble() | ||
{ | ||
var results = AppSettings.Get<double>("DoubleConfig"); | ||
Assert.AreEqual(results, 123.4); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.