public void Submit_AllowsNullPort() { var imposter = new HttpImposter(null, null); Client.Submit(imposter); MockRequestProxy.Verify(x => x.CreateImposter(It.Is <Imposter>(imp => imp.Port == default(int))), Times.Once); }
public async Task Submit_AllowsNullPort() { var imposter = new HttpImposter(null, null); await Client.SubmitAsync(imposter).ConfigureAwait(false); MockRequestProxy.Verify(x => x.CreateImposterAsync(It.Is <Imposter>(imp => imp.Port == default(int))), Times.Once); }
public async Task DeleteAllImposters_CallsDeleteAll() { MockRequestProxy.Setup(x => x.DeleteAllImpostersAsync()).Returns(Task.CompletedTask); Client.Imposters.Add(new HttpImposter(123, null)); Client.Imposters.Add(new HttpImposter(456, null)); await Client.DeleteAllImpostersAsync().ConfigureAwait(false); MockRequestProxy.Verify(x => x.DeleteAllImpostersAsync(), Times.Once); }
public void DeleteAllImposters_CallsDeleteAll() { MockRequestProxy.Setup(x => x.DeleteAllImposters()); Client.Imposters.Add(new HttpImposter(123, null)); Client.Imposters.Add(new HttpImposter(456, null)); Client.DeleteAllImposters(); MockRequestProxy.Verify(x => x.DeleteAllImposters(), Times.Once); }
public async Task CallsDelete() { const int port = 8080; Client.Imposters.Add(new HttpImposter(port, null)); MockRequestProxy.Setup(x => x.DeleteImposterAsync(port)).Returns(Task.CompletedTask); await Client.DeleteImposterAsync(port).ConfigureAwait(false); MockRequestProxy.Verify(x => x.DeleteImposterAsync(port), Times.Once); }
public void CallsDelete() { const int port = 8080; Client.Imposters.Add(new HttpImposter(port, null)); MockRequestProxy.Setup(x => x.DeleteImposter(port)); Client.DeleteImposter(port); MockRequestProxy.Verify(x => x.DeleteImposter(port), Times.Once); }
public void SubmitCollection_ShouldSubmitImpostersUsingProxy() { const int firstPortNumber = 123; const int secondPortNumber = 456; var imposter1 = Client.CreateHttpImposter(firstPortNumber); var imposter2 = Client.CreateHttpImposter(secondPortNumber); Client.Submit(new[] { imposter1, imposter2 }); MockRequestProxy.Verify(x => x.CreateImposter(It.Is <Imposter>(imp => imp.Port == firstPortNumber)), Times.Once); MockRequestProxy.Verify(x => x.CreateImposter(It.Is <Imposter>(imp => imp.Port == secondPortNumber)), Times.Once); }
public void Submit_CallsSubmitOnAllPendingImposters() { const int firstPortNumber = 123; const int secondPortNumber = 456; var imposter1 = new HttpImposter(firstPortNumber, null); var imposter2 = new HttpImposter(secondPortNumber, null); Client.Submit(new[] { imposter1, imposter2 }); MockRequestProxy.Verify(x => x.CreateImposter(It.Is <Imposter>(imp => imp.Port == firstPortNumber)), Times.Once); MockRequestProxy.Verify(x => x.CreateImposter(It.Is <Imposter>(imp => imp.Port == secondPortNumber)), Times.Once); }
public async Task SubmitCollection_ShouldSubmitImpostersUsingProxy() { const int firstPortNumber = 123; const int secondPortNumber = 456; var imposter1 = Client.CreateHttpImposter(firstPortNumber); var imposter2 = Client.CreateHttpImposter(secondPortNumber); await Client.SubmitAsync(new[] { imposter1, imposter2 }).ConfigureAwait(false); MockRequestProxy.Verify(x => x.CreateImposterAsync(It.Is <Imposter>(imp => imp.Port == firstPortNumber)), Times.Once); MockRequestProxy.Verify(x => x.CreateImposterAsync(It.Is <Imposter>(imp => imp.Port == secondPortNumber)), Times.Once); }
public async Task Submit_CallsSubmitOnAllPendingImposters() { const int firstPortNumber = 123; const int secondPortNumber = 456; var imposter1 = new HttpImposter(firstPortNumber, null); var imposter2 = new HttpImposter(secondPortNumber, null); await Client.SubmitAsync(new[] { imposter1, imposter2 }).ConfigureAwait(false); MockRequestProxy.Verify(x => x.CreateImposterAsync(It.Is <Imposter>(imp => imp.Port == firstPortNumber)), Times.Once); MockRequestProxy.Verify(x => x.CreateImposterAsync(It.Is <Imposter>(imp => imp.Port == secondPortNumber)), Times.Once); }