diff --git a/docs/roadmap.md b/docs/roadmap.md index 171c89b79..7a59fa2c2 100755 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -15,16 +15,18 @@ In a __second phase__, I would develop more about core functionality as bank_car In a __third phase__ it would be ideal to be able to carry out a minimal management with an administrator user. So the following user stories would be covered: + +* [(HU3) Add investment fund as customer user](https://github.com/pepitoenpeligro/CloudBanking/issues/15) :pencil: +* [(HU6) Delete fund investment as customer user](https://github.com/pepitoenpeligro/CloudBanking/issues/18) :pencil: + + +In a __fourth phase__ of development it would be necessary to enable the ability to remove financial products from the user account, thus covering the following user stories * [(H17) Disable account](https://github.com/pepitoenpeligro/CloudBanking/issues/29) :pencil: * [(H18) Enable disabled account](https://github.com/pepitoenpeligro/CloudBanking/issues/30) :pencil: * [(HU7) Create saving-group](https://github.com/pepitoenpeligro/CloudBanking/issues/19) :pencil: * [(HU9) Create a payment-group](https://github.com/pepitoenpeligro/CloudBanking/issues/21) :pencil: - -In a __fourth phase__ of development it would be necessary to enable the ability to remove financial products from the user account, thus covering the following user stories -* [(HU3) Add investment fund as customer user](https://github.com/pepitoenpeligro/CloudBanking/issues/15) :pencil: -* [(HU6) Delete fund investment as customer user](https://github.com/pepitoenpeligro/CloudBanking/issues/18) :pencil: -* [(HU8) Exit from saving-group](https://github.com/pepitoenpeligro/CloudBanking/issues/20) -* [(HU10) Exit from payment-group](https://github.com/pepitoenpeligro/CloudBanking/issues/22) +* [(HU8) Exit from saving-group](https://github.com/pepitoenpeligro/CloudBanking/issues/20) :pencil: +* [(HU10) Exit from payment-group](https://github.com/pepitoenpeligro/CloudBanking/issues/22) :pencil: In a __fifth phase__ of development it would be ideal to implement the functionalities related to the creation of alerts on financial products. diff --git a/src/bankfund/test_galvanic.rs b/src/bankfund/test_galvanic.rs new file mode 100755 index 000000000..161b68087 --- /dev/null +++ b/src/bankfund/test_galvanic.rs @@ -0,0 +1,103 @@ +mod test_bankfund_galvanic{ + use galvanic_assert::*; + use galvanic_assert::matchers::*; + + use chrono::{NaiveDate, NaiveDateTime}; + use crate::bankfund::model::bankfund::*; + + + #[test] + /// Test if constructor is correct + fn test_new_fund(){ + let id : String = String::from("507f1f77bcf86cd799439011"); + let amount : f64 = 534.4; + let date_start : NaiveDateTime = NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0); + let date_finish : NaiveDateTime = NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0); + let status : bool = true; + + let bf : Fund = Fund::new(id, amount,date_start,date_finish,status); + + assert_that!(&bf, is_variant!(Fund)); + } + + #[test] + /// Test if ID assignment is correct (inmutable getter - constructor) + fn test_get_id(){ + let id : String = String::from("507f1f77bcf86cd799439011"); + let amount : f64 = 534.4; + let date_start : NaiveDateTime = NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0); + let date_finish : NaiveDateTime = NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0); + let status : bool = true; + + let bf : Fund = Fund::new(id, amount,date_start,date_finish,status); + + assert_that!(bf.get_id(), eq(String::from("507f1f77bcf86cd799439011"))); + } + + + #[test] + /// Test if card_number assignment is correct (inmutable getter - constructor) + fn test_get_amount(){ + + let id : String = String::from("507f1f77bcf86cd799439011"); + let amount : f64 = 534.4; + let date_start : NaiveDateTime = NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0); + let date_finish : NaiveDateTime = NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0); + let status : bool = true; + + let bf : Fund = Fund::new(id, amount,date_start,date_finish,status); + + assert_that!(&bf.get_amount().clone(), eq(534.4)); + } + + + #[test] + /// Test if date assignment is correct (inmutable getter - constructor) + fn test_get_start_date(){ + + let id : String = String::from("507f1f77bcf86cd799439011"); + let amount : f64 = 534.4; + let date_start : NaiveDateTime = NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0); + let date_finish : NaiveDateTime = NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0); + let status : bool = true; + + let bf : Fund = Fund::new(id, amount,date_start,date_finish,status); + + assert_that!(&bf.get_start_date().clone(), is(eq(NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0)))); + } + + + #[test] + /// Test if date assignment is correct (inmutable getter - constructor) + fn test_get_finish_date(){ + + let id : String = String::from("507f1f77bcf86cd799439011"); + let amount : f64 = 534.4; + let date_start : NaiveDateTime = NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0); + let date_finish : NaiveDateTime = NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0); + let status : bool = true; + + let bf : Fund = Fund::new(id, amount,date_start,date_finish,status); + + assert_that!(&bf.get_finish_date().clone(), is(eq(NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0)))); + } + + + #[test] + /// Test if status assignment is correct (inmutable getter - constructor) + fn test_get_status(){ + + let id : String = String::from("507f1f77bcf86cd799439011"); + let amount : f64 = 534.4; + let date_start : NaiveDateTime = NaiveDate::from_ymd(2025, 7, 8).and_hms(22, 18, 0); + let date_finish : NaiveDateTime = NaiveDate::from_ymd(2022, 7, 8).and_hms(22, 18, 0); + let status : bool = true; + + let bf : Fund = Fund::new(id, amount,date_start,date_finish,status); + + assert_that!(&bf.is_active().clone(), is(eq(true))); + } + + + +} \ No newline at end of file