Skip to content

[NhiTT] Do UT For Ex3 to Ex7#41

Open
nhitt-1337 wants to merge 1 commit intosun-unit-test-training:masterfrom
nhitt-1337:nhitt_training_php_unittest
Open

[NhiTT] Do UT For Ex3 to Ex7#41
nhitt-1337 wants to merge 1 commit intosun-unit-test-training:masterfrom
nhitt-1337:nhitt_training_php_unittest

Conversation

@nhitt-1337
Copy link
Copy Markdown

@nhitt-1337 nhitt-1337 commented May 25, 2021

Purpose/Notes

Screenshot

image

Checklist (*)

  • Pull request has been self-reviewed
  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All CI builds passed successfully (all builds are green)

$this->assertEquals($response->getStatusCode(), 200);
$this->assertEquals($response->getData()->discount, $discount);
}
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chị ơi cái này em chưa thấy test mấy case và validate fail ạ

$this->assertEquals($resultClass, $class);
}

public function dateForClass()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dạ cái này suggest comment ko cần sửa ạ:
nên đặt tên hàm là proivder....
Với lị mỗi test case thế này nên chia ra một function ạ.

* @param $shippingExpress
* @param $result
*/
public function testCalculateShippingFee($amount, $premiumMember, $shippingExpress, $result)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cái này nếu test đến C1 thì ít nhất 4 case ạ

  1. shippingFee = 0
    shippingExpressFee = 0
  2. shippingFee = 0
    shippingExpressFee > 0
  3. shippingFee > 0
    shippingExpressFee = 0
  4. shippingFee > 0
    shippingExpressFee > 0
    chị update giúp em hây

$this->assertEquals('exercise07::checkout.index', $view->name());
}

function testStore()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cái này nên đặt tên là test Store success ... rồi chị bổ sung giúp em một case test validate fail thì nó sẽ như thế nào nhé

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants