namespace is not necessary for tests

This commit is contained in:
Chris Cromer 2019-01-15 16:45:41 -03:00
parent 61821ed05d
commit ac4338a57c
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
3 changed files with 32 additions and 38 deletions

View File

@ -1,10 +1,8 @@
namespace SernaturTest {
using LibSernatur.Misc;
using LibSernatur.Misc;
public static int main (string[] args) {
assert (Money.format_int (100000) == "$100.000");
assert (Money.format_uint (100000) == "$100.000");
assert (Money.format_string ("100000") == "$100.000");
return 0;
}
public static int main (string[] args) {
assert (Money.format_int (100000) == "$100.000");
assert (Money.format_uint (100000) == "$100.000");
assert (Money.format_string ("100000") == "$100.000");
return 0;
}

View File

@ -1,11 +1,9 @@
namespace SernaturTest {
using LibSernatur.Misc;
using LibSernatur.Misc;
public static int main (string[] args) {
assert (Percentage.format_float ((float) 0.43) == "43%");
assert (Percentage.format_float ((float) 1) == "100%");
assert (Percentage.format_double (0.43) == "43%");
assert (Percentage.format_double (1) == "100%");
return 0;
}
public static int main (string[] args) {
assert (Percentage.format_float ((float) 0.43) == "43%");
assert (Percentage.format_float ((float) 1) == "100%");
assert (Percentage.format_double (0.43) == "43%");
assert (Percentage.format_double (1) == "100%");
return 0;
}

View File

@ -1,26 +1,24 @@
namespace SernaturTest {
using LibSernatur.Misc;
using LibSernatur.Misc;
public static int main (string[] args) {
try {
Rut rut = new Rut ("18166316-2");
assert (rut.get_clean_rut () == "181663162");
assert (rut.get_rut () == "18.166.316-2");
assert (rut.type () == Rut.Type.RUN);
public static int main (string[] args) {
try {
Rut rut = new Rut ("18166316-2");
assert (rut.get_clean_rut () == "181663162");
assert (rut.get_rut () == "18.166.316-2");
assert (rut.type () == Rut.Type.RUN);
rut = new Rut ("20380508-k");
assert (rut.get_clean_rut () == "20380508K");
assert (rut.get_rut () == "20.380.508-K");
assert (rut.type () == Rut.Type.RUN);
rut = new Rut ("20380508-k");
assert (rut.get_clean_rut () == "20380508K");
assert (rut.get_rut () == "20.380.508-K");
assert (rut.type () == Rut.Type.RUN);
rut = new Rut ("50380508-1");
assert (rut.get_clean_rut () == "503805081");
assert (rut.get_rut () == "50.380.508-1");
assert (rut.type () == Rut.Type.RUT);
}
catch (Error e) {
error (e.message);
}
return 0;
rut = new Rut ("50380508-1");
assert (rut.get_clean_rut () == "503805081");
assert (rut.get_rut () == "50.380.508-1");
assert (rut.type () == Rut.Type.RUT);
}
catch (Error e) {
error (e.message);
}
return 0;
}