public void write_total_number_of_fail_test() { var context = new Specification("a suite test"); context.AddTest(new global::Nala.Framework.Test("a test", () => { new Expected <string>(value: null).ToBeNull(); })); context.AddTest(new global::Nala.Framework.Test("anoter test", () => { new Expected <string>("f").ToBeNull(); })); _specificationWritter.Write(context); writter.Verify(x => x.WriteNumberOfTest(1, 0, 1)); }
public void write_total_number_of_test_in_different_levels_of_depths() { var context = new Specification("a suite test"); context.AddTest(new global::Nala.Framework.Test("a test", () => { new Expected <string>(value: null).ToBeNull(); })); context.AddTest(new global::Nala.Framework.Test("anoter test", () => { new Expected <string>("f").ToBeNull(); })); var anotherContext = new Specification("another suite of tests"); anotherContext.AddTest(new global::Nala.Framework.Test("another test", () => { new Expected <string>("null").ToBeNull(); })); context.AddContext(anotherContext); _specificationWritter.Write(context); writter.Verify(x => x.WriteNumberOfTest(1, 0, 2)); }
public void write_one_fail_test() { const string testSuiteName = "one level test suite"; const string testName = "a success test"; var context = new Specification(testSuiteName); context.AddTest(new global::Nala.Framework.Test(testName, () => { new Expected <string>("another").ToBeNull(); })); _specificationWritter.Write(context); writter.Verify(x => x.WriteSuite(testSuiteName, 0)); writter.Verify(x => x.WriteFailTest(testName, It.IsAny <string>(), 1)); }
public void write_one_success_test() { const string testSuiteName = "one level test suite"; const string testName = "a success test"; var context = new Specification(testSuiteName); context.AddTest(new global::Nala.Framework.Test(testName, () => { })); _specificationWritter.Write(context); writter.Verify(x => x.WriteSuite(testSuiteName, 0)); writter.Verify(x => x.WriteSucessTest(testName, 1)); }