Skip to content

Commit

Permalink
test - real & fake together
Browse files Browse the repository at this point in the history
  • Loading branch information
tmenier committed Nov 22, 2016
1 parent 2c5a458 commit 68c5251
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Test/Flurl.Test.Shared/Http/RealHttpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading;
using System.Threading.Tasks;
using Flurl.Http;
using Flurl.Http.Testing;
using NUnit.Framework;

namespace Flurl.Test.Http
Expand Down Expand Up @@ -208,5 +209,16 @@ public async Task can_handle_error() {
FlurlHttp.Configure(c => c.ResetDefaults());
}
}

[Test]
public async Task can_comingle_real_and_fake_tests() {
// do a fake call while a real call is running
var realTask = "https://www.google.com/".GetStringAsync();
using (new HttpTest()) {
var fake = await "https://www.google.com/".GetStringAsync();
Assert.AreEqual("", fake);
}
Assert.AreNotEqual("", await realTask);
}
}
}

0 comments on commit 68c5251

Please sign in to comment.