mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 01:08:49 +02:00
NET Core 2.1 + support for Service Fabric commandline parameters (#209)
* netcore 2.1 * SimpleCommandLineParserTests * tests * SimpleCommandLineParserTests * test report * AspNetCoreSelfHost * Fixed Resharper warnings * tests * . * ResponseWithProxyTests ResponseWithProxyTests * postmanecho
This commit is contained in:
@@ -14,31 +14,31 @@ namespace WireMock.Net.Tests.Util
|
||||
public void FileHelper_ReadAllTextWithRetryAndDelay()
|
||||
{
|
||||
// Assign
|
||||
var _staticMappingHandlerMock = new Mock<IFileSystemHandler>();
|
||||
_staticMappingHandlerMock.Setup(m => m.ReadMappingFile(It.IsAny<string>())).Returns("text");
|
||||
var staticMappingHandlerMock = new Mock<IFileSystemHandler>();
|
||||
staticMappingHandlerMock.Setup(m => m.ReadMappingFile(It.IsAny<string>())).Returns("text");
|
||||
|
||||
// Act
|
||||
string result = FileHelper.ReadAllTextWithRetryAndDelay(_staticMappingHandlerMock.Object, @"c:\temp");
|
||||
string result = FileHelper.ReadAllTextWithRetryAndDelay(staticMappingHandlerMock.Object, @"c:\temp");
|
||||
|
||||
// Assert
|
||||
Check.That(result).Equals("text");
|
||||
|
||||
// Verify
|
||||
_staticMappingHandlerMock.Verify(m => m.ReadMappingFile(@"c:\temp"), Times.Once);
|
||||
staticMappingHandlerMock.Verify(m => m.ReadMappingFile(@"c:\temp"), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FileHelper_ReadAllTextWithRetryAndDelay_Throws()
|
||||
{
|
||||
// Assign
|
||||
var _staticMappingHandlerMock = new Mock<IFileSystemHandler>();
|
||||
_staticMappingHandlerMock.Setup(m => m.ReadMappingFile(It.IsAny<string>())).Throws<NotSupportedException>();
|
||||
var staticMappingHandlerMock = new Mock<IFileSystemHandler>();
|
||||
staticMappingHandlerMock.Setup(m => m.ReadMappingFile(It.IsAny<string>())).Throws<NotSupportedException>();
|
||||
|
||||
// Act
|
||||
Check.ThatCode(() => FileHelper.ReadAllTextWithRetryAndDelay(_staticMappingHandlerMock.Object, @"c:\temp")).Throws<IOException>();
|
||||
Check.ThatCode(() => FileHelper.ReadAllTextWithRetryAndDelay(staticMappingHandlerMock.Object, @"c:\temp")).Throws<IOException>();
|
||||
|
||||
// Verify
|
||||
_staticMappingHandlerMock.Verify(m => m.ReadMappingFile(@"c:\temp"), Times.Exactly(3));
|
||||
staticMappingHandlerMock.Verify(m => m.ReadMappingFile(@"c:\temp"), Times.Exactly(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user