Guest User

Untitled

a guest
Jan 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. [TestClass]
  2.  
  3. public class HomePageUnitTests
  4. {
  5. [TestMethod]
  6. public void TestHomePageMyRating()
  7. {
  8. var jsHelper = new JavaScriptTestHelper(this.TestContext);
  9.  
  10. // Load JavaScript files
  11.  
  12.  
  13. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestsJavaScriptUnitTestFramework.js");
  14. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestshomePageMyRatingTest.js");
  15.  
  16.  
  17. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.Testsrequire.js");
  18. //jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.Testsjquery-ui-1.10.4.custom.js");
  19. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360add.js");
  20. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360myRatingModel.js");
  21. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360Subtract.js");
  22. // Execute JavaScript Test
  23. //jsHelper.ExecuteTest("testAddNumbers");
  24. //jsHelper.ExecuteTest("myRatingTestWithCompanyId");
  25. jsHelper.ExecuteTest("myRatingTestWithCompanyId");
  26. }
  27.  
  28. [TestMethod]
  29. public void TestMyRatingTestWithOutCompanyId()
  30. {
  31. var jsHelper = new JavaScriptTestHelper(this.TestContext);
  32.  
  33. // Load JavaScript files
  34.  
  35. // C:R360SourceSNL.Services.Application.Common.Tests
  36. //C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360
  37. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestsJavaScriptUnitTestFramework.js");
  38. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestshomePageMyRatingTest.js");
  39. jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360add.js");
  40. //jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360myRatingModel.js");
  41.  
  42. // Execute JavaScript Test
  43.  
  44. jsHelper.ExecuteTest("myRatingTestWithOutCompanyId");
  45.  
  46. }
  47.  
  48. public TestContext TestContext { get; set; }
  49.  
  50. define(["utilities/model"], function (modelUtilities) {
  51.  
  52. function getMyRatingHydrob1(companyId) {
  53.  
  54. return {
  55. hydrobName: "GetR360HomepageCreditRating",
  56. parameters: {
  57. keyinstn: companyId
  58. }
  59. };
  60.  
  61. var getHydrobName = this.getMyRatingHydrob1(companyId);
  62.  
  63. return modelUtilities.getHydrobDataAPIRequest(getHydrobName.hydrobName,
  64. getHydrobName.parameters).then(function (data) {
  65. return processMyRating(data);
  66.  
  67. });
  68.  
  69. return getMyRating(companyId);
  70.  
  71. // Assert
  72. assert.areEqual(5, result, "addNumbers did not return right value!");
  73. }
  74.  
  75. assert.isNotNull(result, "Expected some value to be returned nothing
Add Comment
Please, Sign In to add comment