```
context("Scenario")
test_that("A scenario + a process gives a scenario", {
p1 = Process(a*t, a = 2)
p2 = Process(b*t, b = 1)
p3 = Process(c*sqrt(t), c = 0.5)
s1 = p1 + p2 + p3
expect_true(is(s1, "ScenarioCarbon"))
expect_equal(names(s1@processus), c("p1", "p2", "p3"))
})
test_that("geseval on a scenario works", {
p1 = Process(a*t, a = 2)
p2 = Process(b*t, b = 1)
p3 = Process(c*sqrt(t), c = 0.5)
s = p1 + p2 + p3
v = geseval(s)
expect_equal(v$p1, 2*0:100)
expect_equal(v$p2, 1*0:100)
expect_equal(v$p3, 0.5*sqrt(0:100))
expect_equal(v$total, v$p1 + v$p2 + v$p3)
})
test_that("parameter collision is checked", {
p1 = Process(a*t, a = 2)
p2 = Process(a*t, a = 1)
expect_warning(p1 + p2, "Some parameters \\(a\\) are shared by several processus.")
p1 = Process(a*t + b, a = 2, b = 1)
p2 = Process(b*t + a + c, a = 1, b = 2, c =3)
expect_warning(p1 + p2, "Some parameters \\(a b\\) are shared by several processus.")
p1 = Process(a*t, a = 2)
p2 = Process(b*t, b = 1)
p3 = Process(a+t, a = 1)
s = p1 + p2
expect_warning(s + p3, "Some parameters \\(a\\) are shared by several processus.")
})
test_that("Cast with as.scenario works", {
p = Process(a*t, a = 2)
s = as.scenario(p)
expect_true(is(s, "ScenarioCarbon"))
expect_equal(names(s@processus), "p")
})
test_that("Efficiency coefficient works", {
p1 = Process(a*t, a = 2)
p2 = Process(b*t, b = 3)
s = p1 + p2
efficiency(s) <- 0.7
v = geseval(s)
t = 0:100
expect_equal(v$p1, 2*t)
expect_equal(v$p2, 3*t)
expect_equal(v$total, 0.7*5*t)
})
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.