Commit 3f2aaab4 authored by Falko Schumann's avatar Falko Schumann

Tests für Sicherheitsgrad ergänzt

parent 820526d1
/*
* Segment 5 Intelligente Analyseverfahren, SWE 5.4 Funktionen Fuzzy
* Copyright (C) 2007-2018 BitCtrl Systems GmbH
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact Information:
* BitCtrl Systems GmbH
* Weißenfelser Straße 67
* 04229 Leipzig
* Phone: +49 341-490670
* mailto: info@bitctrl.de
*/
package de.bsvrz.iav.fuzzylib.fuzzylib;
import org.junit.*;
import org.junit.rules.*;
import static org.junit.Assert.*;
public class SicherheitsgradTests {
@Rule
public ExpectedException exception = ExpectedException.none();
@Test
public void konstruktor_Normalfall() {
Sicherheitsgrad s = Sicherheitsgrad.von(0.4);
assertEquals("wert", 0.4, s.getWert(), 0.001);
}
@Test
public void konstruktor_SicherheitsgradKleiner0_Ausnahmefehler() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("Der Sicherheitsgrad muss zwischen 0.0 und 1.0 liegen: -0.1");
Sicherheitsgrad.von(-0.1);
}
@Test
public void konstruktor_SicherheitsgradGroesser1_Ausnahmefehler() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("Der Sicherheitsgrad muss zwischen 0.0 und 1.0 liegen: 1.1");
Sicherheitsgrad.von(1.1);
}
@Test
public void formattierterText() {
Sicherheitsgrad s = Sicherheitsgrad.von(0.4);
assertEquals("0.4", s.toString());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment