Skip to content

Conversation

@datpn-1648
Copy link

@datpn-1648 datpn-1648 commented May 22, 2021

Purpose/Notes

Screenshot

1.Module 3
Screenshot from 2021-05-22 22-27-03
1.Module 4
Screenshot from 2021-05-22 23-19-40
1.Module 6
Screenshot from 2021-05-23 00-03-13
1.Module 7
Screenshot from 2021-05-23 00-44-00
1.Module 9
Screenshot from 2021-05-23 01-01-47

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)

@datpn-1648 datpn-1648 force-pushed the datpn_unit_test_homework branch from 2a54b5b to b106eb1 Compare May 22, 2021 18:17
@datpn-1648 datpn-1648 force-pushed the datpn_unit_test_homework branch from b106eb1 to c88b1a0 Compare May 22, 2021 18:19

$this->assertInstanceOf(ProductFactory::class, $product);
}
} No newline at end of file

Choose a reason for hiding this comment

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

á à

$this->assertInstanceOf(ProductRepository::class, $repository);
}

public function test_all()

Choose a reason for hiding this comment

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

cái tên nên đặt xem test all này sucess hay fail j j đó ạ

$this->checkoutRequest = new CheckoutRequest();
}

public function test_contains_valid_rules()

Choose a reason for hiding this comment

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

Anh ơi cái này nên có khi không cần test kiểu này mà mình sẽ test vào với controller để xem với trường hợp đúng thì response ok không. Với trường hợp request trueyefn vào sai có đúng redirect được đi không ạ.
Cái này mới chỉ là check mình viết có đúng cú pháp chưa thôi ạ

$response->assertViewHas('products');
}

public function test_checkout_success()

Choose a reason for hiding this comment

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

cái này anh thiếu check mấy case khi $paramRequest fail ạ

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

function provideData()

Choose a reason for hiding this comment

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

Anh nên chia case như bài 3 ấy ạ
Với lại thiếu case normal date trả về màu đen ạ

$response->assertViewIs('exercise07::checkout.index');
}

function test_store()

Choose a reason for hiding this comment

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

cũng tương tự anh test giúp em trường hợp validate fail nhé

/**
* @dataProvider provideData
*/
public function test_calculate_shipping_fee($inputData, $expected)

Choose a reason for hiding this comment

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

Mình nên tách theo kiểu từng function với từng test case cho nó clear nhé anh. Không nên lạm dùng provider nhiều quá. Nếu dùng thì cũng comment từng case vào ạ.
Và nếu anh có hứng thú với C2 thì anh thử break thêm case xem sao ạ. Đây mới là C1. Không thì C1 là ok rồi ạ :D

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