Skip to content

Commit

Permalink
Merge pull request #42228 from Dilhasha/fix-test-issues
Browse files Browse the repository at this point in the history
Fix expected and actual fields in the generated tests
  • Loading branch information
Dilhasha authored Feb 26, 2024
2 parents a9b994b + 1955fdc commit d539027
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ function beforeSuiteFunc() {
function testFunction() {
string name = "John";
string welcomeMsg = hello(name);
test:assertEquals("Hello, John", welcomeMsg);
test:assertEquals(welcomeMsg, "Hello, John");
}

// Negative Test function

@test:Config {}
function negativeTestFunction() {
string welcomeMsg = hello(());
test:assertEquals("Hello, World!", welcomeMsg);
test:assertEquals(welcomeMsg, "Hello, World!");
}

// After Suite Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ballerina/test;
function testFunction() {
string name = "John";
string welcomeMsg = hello(name);
test:assertEquals("Hello, John", welcomeMsg);
test:assertEquals(welcomeMsg, "Hello, John");
}

// Negative Test function
Expand All @@ -15,5 +15,5 @@ function testFunction() {
function negativeTestFunction() {
string name = "";
string welcomeMsg = hello(name);
test:assertEquals("Hello, World!", welcomeMsg);
test:assertEquals(welcomeMsg, "Hello, World!");
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ballerina/test;
function testFunction() {
string name = "John";
string welcomeMsg = hello(name);
test:assertEquals("Hello, John", welcomeMsg);
test:assertEquals(welcomeMsg, "Hello, John");
}

// Negative Test function
Expand All @@ -15,5 +15,5 @@ function testFunction() {
function negativeTestFunction() {
string name = "";
string welcomeMsg = hello(name);
test:assertEquals("Hello, World!", welcomeMsg);
test:assertEquals(welcomeMsg, "Hello, World!");
}

0 comments on commit d539027

Please sign in to comment.