public void post_cancelGame_third_party_exception_test() { // Assert SaveFailRequestToDb() be called once _api = new FakeServerApi(); Action action = () => _api.CancelGame(); action.Should().Throw <WebException>(); Assert.AreEqual(1, FakeServerApi.SaveFailRequestToDbCalledCount); }
public void post_cancelGame_third_party_success_test() { // Assert success _api = new FakeServerApi1(0); Assert.AreEqual(ServerResponse.Correct, _api.CancelGame()); }
public void post_cancelGame_third_party_fail_test() { // Assert PostToThirdParty() return not correct should throw AuthFailException _api = new FakeServerApi1(99); Assert.ThrowsException <AuthFailException>(() => _api.CancelGame()); }