public void CheckLoginTest() { string ok_mail = TestUtility.TestData[TestUtility.KEY_OK_MAIL]; string ok_pass = TestUtility.TestData[TestUtility.KEY_OK_PASS]; TestUtility.Message("Running CheckLoginTest"); network_.SetCookieKind(NicoNetwork.CookieKind.None); network_.ClearCookie(); msgout_.OnWriteLine = delegate(string str) { Assert.Fail("CheckLoginTest1"); }; msgout_.OnWrite = delegate(string str) { Assert.That(str, Is.EqualTo("ログインされていません。\r\n"), "CheckLoginTest2"); }; network_manager_.CheckLogin(); network_.LoginNiconico(ok_mail, ok_pass); msgout_.OnWrite = delegate(string str) { Assert.That(str, Is.EqualTo("ログインされています。\r\n"), "CheckLoginTest3"); }; network_manager_.CheckLogin(); }
public void CheckAndLoginNiconicoTest() { string ok_mail = TestUtility.TestData[TestUtility.KEY_OK_MAIL]; string ok_pass = TestUtility.TestData[TestUtility.KEY_OK_PASS]; string ng_pass = TestUtility.TestData[TestUtility.KEY_NG_PASS]; network_.ClearCookie(); network_.SetCookieKind(NicoNetwork.CookieKind.None); TestUtility.Wait(); TestUtility.Message("Running CheckAndLoginNiconicoTest1."); bool result = network_.CheckAndLoginNiconico(ok_mail, ok_pass); Assert.That(result, Is.True, "CheckAndLoginNiconicoTest1"); network_.ClearCookie(); TestUtility.Wait(); TestUtility.Message("Running CheckAndLoginNiconicoTest2."); result = network_.CheckAndLoginNiconico(ok_mail, ng_pass); Assert.That(result, Is.False, "CheckAndLoginNiconicoTest2"); TestUtility.Wait(); TestUtility.Message("Running CheckAndLoginNiconicoTest3."); result = network_.CheckAndLoginNiconico(ok_mail, ok_pass); Assert.That(result, Is.True, "CheckAndLoginNiconicoTest3"); }