mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 14:52:31 +00:00
tests
This commit is contained in:
1 parent
b7a7c8e3a2
commit
205ef8c3d8
1 file changed
+36
+36
@@ -328,6 +328,15 @@ mod tests {
|
||||
assert!((cost.usd_cents_fractional - 95.6576).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consumer_cents_480p_10s() {
|
||||
let cost = r480(10).calculate_consumer_costs();
|
||||
assert_eq!(cost.kinovi_credits, 461.5);
|
||||
assert_eq!(cost.usd_cents_rounded_up, 240);
|
||||
assert_eq!(cost.usd_cents_rounded_down, 239);
|
||||
assert!((cost.usd_cents_fractional - 239.144).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consumer_cents_480p_15s() {
|
||||
let cost = r480(15).calculate_consumer_costs();
|
||||
@@ -346,6 +355,15 @@ mod tests {
|
||||
assert!((cost.usd_cents_fractional - 190.7555).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consumer_cents_720p_10s() {
|
||||
let cost = r720(10).calculate_consumer_costs();
|
||||
assert_eq!(cost.kinovi_credits, 920.3);
|
||||
assert_eq!(cost.usd_cents_rounded_up, 477);
|
||||
assert_eq!(cost.usd_cents_rounded_down, 476);
|
||||
assert!((cost.usd_cents_fractional - 476.8888).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consumer_cents_720p_30s() {
|
||||
let cost = r720(30).calculate_consumer_costs();
|
||||
@@ -364,6 +382,15 @@ mod tests {
|
||||
assert!((cost.usd_cents_fractional - 69.3042).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enterprise_cents_480p_10s() {
|
||||
let cost = r480(10).calculate_enterprise_costs();
|
||||
assert_eq!(cost.kinovi_credits, 421.3);
|
||||
assert_eq!(cost.usd_cents_rounded_up, 174);
|
||||
assert_eq!(cost.usd_cents_rounded_down, 173);
|
||||
assert!((cost.usd_cents_fractional - 173.2604).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enterprise_cents_480p_15s() {
|
||||
let cost = r480(15).calculate_enterprise_costs();
|
||||
@@ -382,6 +409,15 @@ mod tests {
|
||||
assert!((cost.usd_cents_fractional - 138.6083).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enterprise_cents_720p_10s() {
|
||||
let cost = r720(10).calculate_enterprise_costs();
|
||||
assert_eq!(cost.kinovi_credits, 842.6);
|
||||
assert_eq!(cost.usd_cents_rounded_up, 347);
|
||||
assert_eq!(cost.usd_cents_rounded_down, 346);
|
||||
assert!((cost.usd_cents_fractional - 346.5208).abs() < FLOAT_TOLERANCE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enterprise_cents_720p_30s() {
|
||||
let cost = r720(30).calculate_enterprise_costs();
|
||||
|
||||
Reference in new issue
Block a user