/// <summary> /// This is a helper method to provide Tempdata context to the test /// </summary> public static TempDataDictionary AuthorizeApplication() { OAuthController controller = new OAuthController(); controller.TempData = new TempDataDictionary(); var result = controller.AuthorizeApplication() as ViewResult; return((TempDataDictionary)result.TempData); }
public void TestAuthorizationWithCorrectKeys() { // Arrange OAuthController controller = new OAuthController(); // Act ViewResult result = controller.AuthorizeApplication() as ViewResult; // Assert Assert.IsNotNull(result); Assert.AreNotEqual("Error", result.ViewName); }
public void TestAuthorizationWithWrongorEmptyKeys() { // Arrange Mock <IConfigurationModel> configuration = TestHelper.GetMockedConfiguration(); OAuthController controller = new OAuthController(); controller.Configuration = configuration.Object; // Act ViewResult result = controller.AuthorizeApplication() as ViewResult; // Assert Assert.AreEqual("Error", result.ViewName); }