Created
November 27, 2015 04:28
-
-
Save brendanmckenzie/856077e875d94be3dbce to your computer and use it in GitHub Desktop.
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
public class ResourceUtilTests | |
{ | |
#region Public Methods | |
[Fact] | |
public void Get_ExistingResource_ReturnsContents() | |
{ | |
// Arrange | |
const string ResourceName = "Resources.ExampleResource.txt"; | |
// Act | |
var contents = Utils.ResourceUtil.Get<ResourceUtilTests>(ResourceName); | |
// Assert | |
Assert.Equal("Hello.", contents); | |
} | |
[Fact] | |
public void Get_NonExistentResource_ThrowsException() | |
{ | |
// Arrange | |
const string ResourceName = "Resources.__NON_EXISTENT__.txt"; | |
// Assert | |
Assert.Throws<Utils.ResourceNotFoundException>(() => | |
{ | |
Utils.ResourceUtil.Get<ResourceUtilTests>(ResourceName); | |
}); | |
} | |
[Fact] | |
public void Get_NullName_ThrowsException() | |
{ | |
// Assert | |
Assert.Throws<ArgumentNullException>(() => | |
{ | |
Utils.ResourceUtil.Get<ResourceUtilTests>(null); | |
}); | |
} | |
#endregion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment