Skip to content

Commit

Permalink
#15 updating model bankfund and #18 delete fund
Browse files Browse the repository at this point in the history
  • Loading branch information
José Antonio Córdoba Gómez committed Dec 11, 2020
1 parent 4abfc55 commit e9c1800
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
103 changes: 103 additions & 0 deletions src/bankfund/test_galvanic.rs
Original file line number Diff line number Diff line change
@@ -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)));
}



}

0 comments on commit e9c1800

Please sign in to comment.