-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 902cf38
Showing
6 changed files
with
1,978 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
jobs: | ||
wollok-ts: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
wget -O wollok-ts-cli https://github.com/uqbar-project/wollok-ts-cli/releases/latest/download/wollok-ts-cli-linux-x64 | ||
chmod a+x ./wollok-ts-cli | ||
./wollok-ts-cli test --skipValidations -p ./ | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
|
||
## example | ||
|
||
TODO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
object salaNumerada { | ||
|
||
var sonido = estandar | ||
const entradaBase = 8000 | ||
|
||
method precioEntrada() = entradaBase + sonido.adicional(self) | ||
|
||
method sonido(algo){ | ||
sonido = algo | ||
} | ||
method asientos() = 240 | ||
} | ||
|
||
|
||
object salaNoNumerada { | ||
|
||
var sonido = estandar | ||
const entradaBase = 9000 | ||
const precioAsiento = 1 | ||
var asientos = 50 | ||
|
||
method precioEntrada() = | ||
(entradaBase - asientos * precioAsiento + sonido.adicional(self)).min(10000).max(0) | ||
|
||
|
||
method sonido(algo){ | ||
sonido = algo | ||
} | ||
|
||
method variarAsientos(cantidad){ | ||
asientos = asientos + cantidad | ||
} | ||
method asientos() = asientos | ||
|
||
} | ||
|
||
|
||
|
||
object qwert{ | ||
|
||
method adicional(sala) = sala.asientos()*13 | ||
} | ||
|
||
object dolby{ | ||
method adicional(sala) = if (sala.asientos() < 150) 1000 else 2000 | ||
} | ||
|
||
object estandar{ | ||
method adicional(_) = 0 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "cine", | ||
"version": "1.0.0", | ||
"wollokVersion": "4.0.0", | ||
"author": "lucas", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import cines.* | ||
|
||
describe "group of tests for cine" { | ||
|
||
test "valor de una entrada para sala numerada con sonido estandar "{ | ||
assert.equals(8000 , salaNumerada.precioEntrada()) | ||
} | ||
|
||
test "valor de una entrada para sala numerada con sonido qwert "{ | ||
salaNumerada.sonido(qwert) | ||
assert.equals(8000 + 13*240 , salaNumerada.precioEntrada()) | ||
} | ||
|
||
test "valor de una entrada para sala numerada con sonido Dolby"{ | ||
salaNumerada.sonido(dolby) | ||
assert.equals(8000 + 2000 , salaNumerada.precioEntrada()) | ||
} | ||
|
||
|
||
test "valor de una entrada para sala no numerada con sonido estandar "{ | ||
assert.equals(9000 - 50 , salaNoNumerada.precioEntrada()) | ||
} | ||
|
||
test "valor de una entrada para sala no numerada con sonido qwert "{ | ||
salaNoNumerada.sonido(qwert) | ||
assert.equals(9000 + 13*50 - 50 , salaNoNumerada.precioEntrada()) | ||
} | ||
|
||
test "valor de una entrada para sala no numerada con sonido Dolby"{ | ||
salaNoNumerada.sonido(dolby) | ||
assert.equals(9000 + 1000 - 50, salaNoNumerada.precioEntrada()) | ||
} | ||
|
||
test "Entrada gratuita para salas multitudinarias con sonido dolby "{ | ||
salaNoNumerada.sonido(dolby) | ||
salaNoNumerada.variarAsientos(50000) | ||
assert.equals(0, salaNoNumerada.precioEntrada()) | ||
} | ||
|
||
test "Entrada precio maximo para salas mediana con sonido qwert "{ | ||
salaNoNumerada.sonido(qwert) | ||
salaNoNumerada.variarAsientos(240) | ||
assert.equals(10000, salaNoNumerada.precioEntrada()) | ||
} | ||
|
||
|
||
} |