Last active
November 21, 2018 13:04
-
-
Save labra/660f4944af612fef2f26 to your computer and use it in GitHub Desktop.
CursoTest
This file contains hidden or 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
const assert = require('assert'); | |
const { Curso } = require("../Curso"); | |
describe('Curso', function() { | |
describe('Gestión de cursos', function() { | |
it('debe crear un curso', function() { | |
var c = new Curso("C1") | |
assert.equal("C1",c.getNombre()); | |
}); | |
it('debe añadir un alumno y buscar su nota', function() { | |
var c = new Curso("C1") | |
c.ponNota(12,2.3); | |
assert.equal(2.3,c.getNota(12)); | |
}); | |
it('debe añadir 2 alumnos y buscar la nota del primero', function() { | |
var c = new Curso("C1") | |
c.ponNota(12,2.3); | |
c.ponNota(33,6); | |
assert.equal(2.3,c.getNota(12)); | |
}); | |
it('debe añadir 2 alumnos y buscar la nota del segundo', function() { | |
var c = new Curso("C1") | |
c.ponNota(12,2.3); | |
c.ponNota(33,6); | |
assert.equal(6,c.getNota(33)); | |
}); | |
it('debe añadir 2 alumnos y calcular la media', function() { | |
var c = new Curso("C1") | |
c.ponNota(12,2.3); | |
c.ponNota(33,6); | |
assert.equal(4.15,c.media()); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment