Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestClass]
- public class HomePageUnitTests
- {
- [TestMethod]
- public void TestHomePageMyRating()
- {
- var jsHelper = new JavaScriptTestHelper(this.TestContext);
- // Load JavaScript files
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestsJavaScriptUnitTestFramework.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestshomePageMyRatingTest.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.Testsrequire.js");
- //jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.Testsjquery-ui-1.10.4.custom.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360add.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360myRatingModel.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360Subtract.js");
- // Execute JavaScript Test
- //jsHelper.ExecuteTest("testAddNumbers");
- //jsHelper.ExecuteTest("myRatingTestWithCompanyId");
- jsHelper.ExecuteTest("myRatingTestWithCompanyId");
- }
- [TestMethod]
- public void TestMyRatingTestWithOutCompanyId()
- {
- var jsHelper = new JavaScriptTestHelper(this.TestContext);
- // Load JavaScript files
- // C:R360SourceSNL.Services.Application.Common.Tests
- //C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestsJavaScriptUnitTestFramework.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.TestshomePageMyRatingTest.js");
- jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360add.js");
- //jsHelper.LoadFile(@"C:R360SourceSNL.Services.Application.Common.ServiceContentmodelsr360myRatingModel.js");
- // Execute JavaScript Test
- jsHelper.ExecuteTest("myRatingTestWithOutCompanyId");
- }
- public TestContext TestContext { get; set; }
- define(["utilities/model"], function (modelUtilities) {
- function getMyRatingHydrob1(companyId) {
- return {
- hydrobName: "GetR360HomepageCreditRating",
- parameters: {
- keyinstn: companyId
- }
- };
- var getHydrobName = this.getMyRatingHydrob1(companyId);
- return modelUtilities.getHydrobDataAPIRequest(getHydrobName.hydrobName,
- getHydrobName.parameters).then(function (data) {
- return processMyRating(data);
- });
- return getMyRating(companyId);
- // Assert
- assert.areEqual(5, result, "addNumbers did not return right value!");
- }
- assert.isNotNull(result, "Expected some value to be returned nothing
Add Comment
Please, Sign In to add comment