initial commit
This commit is contained in:
13
exercises/03_ticket_v1/12_outro/src/lib.rs
Normal file
13
exercises/03_ticket_v1/12_outro/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
// TODO: Define a new `Order` type.
|
||||
// It should keep track of three pieces of information: `product_name`, `quantity`, and `unit_price`.
|
||||
// The product name can't be empty and it can't be longer than 300 bytes.
|
||||
// The quantity must be strictly greater than zero.
|
||||
// The unit price is in cents and must be strictly greater than zero.
|
||||
// Order must include a method named `total` that returns the total price of the order.
|
||||
// Order must provide setters and getters for each field.
|
||||
//
|
||||
// Tests are located in a different place this time—in the `tests` folder.
|
||||
// The `tests` folder is a special location for `cargo`. It's where it looks for **integration tests**.
|
||||
// Integration here has a very specific meaning: they test **the public API** of your project.
|
||||
// You'll need to pay attention to the visibility of your types and methods; integration
|
||||
// tests can't access private or `pub(crate)` items.
|
||||
Reference in New Issue
Block a user