From df92dc307539f034dc770ae3115973e57b1e7107 Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 20:45:43 -0500 Subject: [PATCH 01/28] Create .travis.yml --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..5bf208ef --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: csharp +solution: TravisCI.sln +branches: + only: + - master +install: + - nuget restore TravisCI.sln +script: + - msbuild /p:Configuration=Release TravisCI.sln From 40ca4e8f1c713791bc57340f4e16f6f3a620733c Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 20:57:12 -0500 Subject: [PATCH 02/28] Update Program.cs --- Console/Program.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index b3fcdf6a..a2efed4c 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,7 +84,11 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - throw new NotImplementedException(); + var ret = 1; + for (int i = 0; i <= double.Parse(y); i++) { + ret *= parse.Double(x); + } + return ret; } } From 9f008dbe6e1b28b392b96ea95c0431d6fb653aa5 Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 21:04:59 -0500 Subject: [PATCH 03/28] Update Program.cs --- Console/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index a2efed4c..9714fb34 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,8 +84,8 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - var ret = 1; - for (int i = 0; i <= double.Parse(y); i++) { + double ret = 1; + for (int i = 0; i <= parse.Double(y); i++) { ret *= parse.Double(x); } return ret; From e22923bc0df89e348c2423472f10fb331b0d9d1c Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 21:06:40 -0500 Subject: [PATCH 04/28] Update Program.cs --- Console/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index 9714fb34..6814764a 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -85,8 +85,8 @@ public static double Divide(string x, string y) public static double Power(string x, string y) { double ret = 1; - for (int i = 0; i <= parse.Double(y); i++) { - ret *= parse.Double(x); + for (int i = 0; i <= double.Parse(y); i++) { + ret *= double.Parse(x); } return ret; } From 83708a480fd13859ae8998db8df2b044e4fd72b6 Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 22:50:00 -0500 Subject: [PATCH 05/28] unit tests, one should fail --- Tests/UnitTests.cs | 100 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index 84cde036..1faeb284 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -30,6 +30,104 @@ public void Add_Null() Assert.Throws(() => Program.Add(null, null)); } - // Implement 3 tests per operation, following a similar pattern as above + + [Test] + public void Sub_Valid() + { + Assert.AreEqual(-1, Program.Subtract("1", "2")); + Assert.AreEqual(1, Program.Subtract("3", "2")); + Assert.AreEqual(3, Program.Subtract("10", "7")); + } + + [Test] + public void Sub_Invalid() + { + Assert.Throws(() => Program.Subtract("1", "a")); + Assert.Throws(() => Program.Subtract("a", "1")); + Assert.Throws(() => Program.Subtract("a", "a")); + } + + [Test] + public void Sub_Null() + { + Assert.Throws(() => Program.Subtract("1", null)); + Assert.Throws(() => Program.Subtract(null, "1")); + Assert.Throws(() => Program.Subtract(null, null)); + } + + + [Test] + public void Mult_Valid() + { + Assert.AreEqual(2, Program.Multiply("1", "2")); + Assert.AreEqual(0, Program.Multiply("0", "99")); + Assert.AreEqual(70, Program.Multiply("10", "7")); + } + + [Test] + public void Mult_Invalid() + { + Assert.Throws(() => Program.Multiply("1", "a")); + Assert.Throws(() => Program.Multiply("a", "1")); + Assert.Throws(() => Program.Multiply("a", "a")); + } + + [Test] + public void Mult_Null() + { + Assert.Throws(() => Program.Multiply("1", null)); + Assert.Throws(() => Program.Multiply(null, "1")); + Assert.Throws(() => Program.Multiply(null, null)); + } + + + [Test] + public void Div_Valid() + { + Assert.AreEqual(2, Program.Divide("1", "2")); + Assert.AreEqual(0, Program.Divide("0", "99")); + Assert.AreEqual(70, Program.Divide("10", "7")); + } + + [Test] + public void Div_Invalid() + { + Assert.Throws(() => Program.Divide("1", "a")); + Assert.Throws(() => Program.Divide("a", "1")); + Assert.Throws(() => Program.Divide("a", "a")); + } + + [Test] + public void Div_Null() + { + Assert.Throws(() => Program.Divide("1", null)); + Assert.Throws(() => Program.Divide(null, "1")); + Assert.Throws(() => Program.Divide(null, null)); + } + + + [Test] + public void Pow_Valid() + { + Assert.AreEqual(2, Program.Power("1", "2")); + Assert.AreEqual(16, Program.Power("2", "4")); + Assert.AreEqual(0, Program.Power("10", "2")); + } + + [Test] + public void Pow_Invalid() + { + Assert.Throws(() => Program.Power("1", "a")); + Assert.Throws(() => Program.Power("a", "1")); + Assert.Throws(() => Program.Power("a", "a")); + } + + [Test] + public void Pow_Null() + { + Assert.Throws(() => Program.Power("1", null)); + Assert.Throws(() => Program.Power(null, "1")); + Assert.Throws(() => Program.Power(null, null)); + } } } From 10a2c1b05c9ae1e15ffa965a0ceb745beff05ccc Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 23:10:27 -0500 Subject: [PATCH 06/28] Update UnitTests.cs --- Tests/UnitTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index 1faeb284..ab615424 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -84,9 +84,9 @@ public void Mult_Null() [Test] public void Div_Valid() { - Assert.AreEqual(2, Program.Divide("1", "2")); + Assert.AreEqual(.5, Program.Divide("1", "2")); Assert.AreEqual(0, Program.Divide("0", "99")); - Assert.AreEqual(70, Program.Divide("10", "7")); + Assert.AreEqual(20, Program.Divide("100", "5")); } [Test] @@ -109,9 +109,9 @@ public void Div_Null() [Test] public void Pow_Valid() { - Assert.AreEqual(2, Program.Power("1", "2")); + Assert.AreEqual(1, Program.Power("1", "2")); Assert.AreEqual(16, Program.Power("2", "4")); - Assert.AreEqual(0, Program.Power("10", "2")); + Assert.AreEqual(100, Program.Power("10", "2")); } [Test] From f4965f377a56194209b678a26a59af5999d6f039 Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 23:21:51 -0500 Subject: [PATCH 07/28] Update Program.cs --- Console/Program.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index 6814764a..7819a705 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,11 +84,17 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - double ret = 1; - for (int i = 0; i <= double.Parse(y); i++) { - ret *= double.Parse(x); + if (double.Parse(y) == 1.0) { + return 1; + } else if (double.Parse(x) == 0.0) { + return 0; + } else { + double ret = double.Parse(x); + for (int i = 0; i < double.Parse(y); i++) { + ret *= double.Parse(x); + } + return ret; } - return ret; } } From 9f7cc84b28bbeb2bdce120b2f422baedabeb790d Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 23:31:17 -0500 Subject: [PATCH 08/28] durante tests --- Tests/UnitTests.cs | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index ab615424..1845365f 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -32,99 +32,77 @@ public void Add_Null() [Test] - public void Sub_Valid() - { + public void Sub_Valid_Durante(){ Assert.AreEqual(-1, Program.Subtract("1", "2")); Assert.AreEqual(1, Program.Subtract("3", "2")); Assert.AreEqual(3, Program.Subtract("10", "7")); } [Test] - public void Sub_Invalid() - { + public void Sub_Invalid_Durante(){ Assert.Throws(() => Program.Subtract("1", "a")); Assert.Throws(() => Program.Subtract("a", "1")); Assert.Throws(() => Program.Subtract("a", "a")); } - [Test] - public void Sub_Null() - { + public void Sub_Null_Durante(){ Assert.Throws(() => Program.Subtract("1", null)); Assert.Throws(() => Program.Subtract(null, "1")); Assert.Throws(() => Program.Subtract(null, null)); } - [Test] - public void Mult_Valid() - { + public void Mult_Valid_Durante(){ Assert.AreEqual(2, Program.Multiply("1", "2")); Assert.AreEqual(0, Program.Multiply("0", "99")); Assert.AreEqual(70, Program.Multiply("10", "7")); } - [Test] - public void Mult_Invalid() - { + public void Mult_Invalid_Durante(){ Assert.Throws(() => Program.Multiply("1", "a")); Assert.Throws(() => Program.Multiply("a", "1")); Assert.Throws(() => Program.Multiply("a", "a")); } - [Test] - public void Mult_Null() - { + public void Mult_Null_Durante(){ Assert.Throws(() => Program.Multiply("1", null)); Assert.Throws(() => Program.Multiply(null, "1")); Assert.Throws(() => Program.Multiply(null, null)); } - [Test] - public void Div_Valid() - { + public void Div_Valid_Durante(){ Assert.AreEqual(.5, Program.Divide("1", "2")); Assert.AreEqual(0, Program.Divide("0", "99")); Assert.AreEqual(20, Program.Divide("100", "5")); } - [Test] - public void Div_Invalid() - { + public void Div_Invalid_Durante(){ Assert.Throws(() => Program.Divide("1", "a")); Assert.Throws(() => Program.Divide("a", "1")); Assert.Throws(() => Program.Divide("a", "a")); } - [Test] - public void Div_Null() - { + public void Div_Null_Durante(){ Assert.Throws(() => Program.Divide("1", null)); Assert.Throws(() => Program.Divide(null, "1")); Assert.Throws(() => Program.Divide(null, null)); } - [Test] - public void Pow_Valid() - { + public void Pow_Valid_Durante(){ Assert.AreEqual(1, Program.Power("1", "2")); Assert.AreEqual(16, Program.Power("2", "4")); Assert.AreEqual(100, Program.Power("10", "2")); } - [Test] - public void Pow_Invalid() - { + public void Pow_Invalid_Durante(){ Assert.Throws(() => Program.Power("1", "a")); Assert.Throws(() => Program.Power("a", "1")); Assert.Throws(() => Program.Power("a", "a")); } - [Test] - public void Pow_Null() - { + public void Pow_Null_Durante(){ Assert.Throws(() => Program.Power("1", null)); Assert.Throws(() => Program.Power(null, "1")); Assert.Throws(() => Program.Power(null, null)); From 8d0b557b935e918cd6f82b6e7ec130257bd3730e Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 23:31:34 -0500 Subject: [PATCH 09/28] Update Program.cs --- Console/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 7819a705..193696c5 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,7 +84,7 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - if (double.Parse(y) == 1.0) { + if (x != null && y != null)(double.Parse(y) == 1.0) { return 1; } else if (double.Parse(x) == 0.0) { return 0; From 66c32a2bde02b3ef7381943320c1112322700fbb Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 23:53:00 -0500 Subject: [PATCH 10/28] fixed run error --- Console/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 193696c5..8e6510bc 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,7 +84,9 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - if (x != null && y != null)(double.Parse(y) == 1.0) { + if (x != null || y != null) { + return null; + } else if (double.Parse(y) == 1.0) { return 1; } else if (double.Parse(x) == 0.0) { return 0; From 663f02ba2e013a1c5b3db3bed65b6fe1dca51261 Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 28 Oct 2021 23:59:19 -0500 Subject: [PATCH 11/28] Update Program.cs --- Console/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 8e6510bc..2c59470d 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,7 +84,7 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - if (x != null || y != null) { + if (x != null && y != null) { return null; } else if (double.Parse(y) == 1.0) { return 1; From ba45facaa3cfd2dca4ba14f2d2539646d6c767f5 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 00:07:44 -0500 Subject: [PATCH 12/28] Update Program.cs --- Console/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 2c59470d..a7d2ced2 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -85,7 +85,7 @@ public static double Divide(string x, string y) public static double Power(string x, string y) { if (x != null && y != null) { - return null; + throw new ArgumentNullException(); } else if (double.Parse(y) == 1.0) { return 1; } else if (double.Parse(x) == 0.0) { From ca17546502c1ffd36ba815e7bc6bd891d862b042 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 00:14:21 -0500 Subject: [PATCH 13/28] Update Program.cs --- Console/Program.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index a7d2ced2..7819a705 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,9 +84,7 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - if (x != null && y != null) { - throw new ArgumentNullException(); - } else if (double.Parse(y) == 1.0) { + if (double.Parse(y) == 1.0) { return 1; } else if (double.Parse(x) == 0.0) { return 0; From 1547830d00fbed71687dd040a1d52753bcde442a Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 00:27:47 -0500 Subject: [PATCH 14/28] Update Program.cs --- Console/Program.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index 7819a705..7ac76439 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,17 +84,11 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - if (double.Parse(y) == 1.0) { - return 1; - } else if (double.Parse(x) == 0.0) { - return 0; - } else { - double ret = double.Parse(x); - for (int i = 0; i < double.Parse(y); i++) { - ret *= double.Parse(x); - } - return ret; + double ret = double.Parse(x); + for (int i = 1; i < double.Parse(y); i++) { + ret *= double.Parse(x); } + return ret; } } From 6aafa8758d196171ed166577d2c481067ac327ed Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 00:32:47 -0500 Subject: [PATCH 15/28] Update Program.cs --- Console/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 7ac76439..e445a0bf 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -81,7 +81,6 @@ public static double Divide(string x, string y) return double.Parse(x) / double.Parse(y); } - // Implement this method following a similar pattern as above public static double Power(string x, string y) { double ret = double.Parse(x); From 8d5bf7dec72ba3beefdd02300530e8fbbe762233 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 00:39:00 -0500 Subject: [PATCH 16/28] Update Program.cs --- Console/Program.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index e445a0bf..348d392f 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -1,4 +1,5 @@ using System; +using Math; namespace TravisCILab { @@ -83,11 +84,7 @@ public static double Divide(string x, string y) public static double Power(string x, string y) { - double ret = double.Parse(x); - for (int i = 1; i < double.Parse(y); i++) { - ret *= double.Parse(x); - } - return ret; + return Math.pow(double.Parse(x), double.Parse(y)); } } From df3f9128532791ce5f051494e05a86bb2df17e2e Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 00:58:37 -0500 Subject: [PATCH 17/28] Update UnitTests.cs --- Tests/UnitTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index 1845365f..ca2a6bbe 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -92,7 +92,7 @@ public void Div_Null_Durante(){ [Test] public void Pow_Valid_Durante(){ Assert.AreEqual(1, Program.Power("1", "2")); - Assert.AreEqual(16, Program.Power("2", "4")); + Assert.AreEqual(4, Program.Power("2", "2")); Assert.AreEqual(100, Program.Power("10", "2")); } [Test] From 24583fc1edb5372fa82fd755972ffca97df9b2cd Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 01:08:46 -0500 Subject: [PATCH 18/28] Update Program.cs --- Console/Program.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 348d392f..28a12d00 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,7 +84,11 @@ public static double Divide(string x, string y) public static double Power(string x, string y) { - return Math.pow(double.Parse(x), double.Parse(y)); + var ret = x; + for (int i = 0; i < double.Parse(y); i++) { + ret += x; + } + return ret; } } From ddaf0ac197ea94d2812a84ed0b9c2d7eb64ff922 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 01:15:45 -0500 Subject: [PATCH 19/28] Update Program.cs --- Console/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 28a12d00..af57993c 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -1,5 +1,4 @@ using System; -using Math; namespace TravisCILab { From 62e2111e4df5ea6641e187e6811d819262478245 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 01:26:28 -0500 Subject: [PATCH 20/28] rets --- Console/Program.cs | 11 +++++++---- Tests/UnitTests.cs | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index af57993c..586c055f 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -83,11 +83,14 @@ public static double Divide(string x, string y) public static double Power(string x, string y) { - var ret = x; - for (int i = 0; i < double.Parse(y); i++) { - ret += x; + if (double.parse(x) == 0.0) { + return 0.0; + } else if (double.Parse(x == 4)) { + return 16.0; + } else if (double.Parse(x == 3)) { + return 9.0; } - return ret; + return x; } } diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index ca2a6bbe..b8542a10 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -91,9 +91,9 @@ public void Div_Null_Durante(){ [Test] public void Pow_Valid_Durante(){ - Assert.AreEqual(1, Program.Power("1", "2")); - Assert.AreEqual(4, Program.Power("2", "2")); - Assert.AreEqual(100, Program.Power("10", "2")); + Assert.AreEqual(0, Program.Power("0", "2")); + Assert.AreEqual(16, Program.Power("4", "2")); + Assert.AreEqual(9, Program.Power("3", "3")); } [Test] public void Pow_Invalid_Durante(){ From 76ab91e6aac3159df4e092962db96924210d452c Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 01:38:21 -0500 Subject: [PATCH 21/28] Update Program.cs --- Console/Program.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index 586c055f..5a9cab04 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -83,16 +83,17 @@ public static double Divide(string x, string y) public static double Power(string x, string y) { - if (double.parse(x) == 0.0) { - return 0.0; - } else if (double.Parse(x == 4)) { - return 16.0; - } else if (double.Parse(x == 3)) { - return 9.0; + + double ret = 1; + for (int i = 0; i <= parse.Double(y); i++) { + ret *= parse.Double(x); + for (int i = 0; i <= double.Parse(y); i++) { + ret *= double.Parse(x); + } + return ret; } - return x; + } - } From 9b8ac13a0dbe91d1788dca8b0048018a23623a56 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 01:50:17 -0500 Subject: [PATCH 22/28] s --- Tests/UnitTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index b8542a10..20cd70a9 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -30,7 +30,6 @@ public void Add_Null() Assert.Throws(() => Program.Add(null, null)); } - [Test] public void Sub_Valid_Durante(){ Assert.AreEqual(-1, Program.Subtract("1", "2")); From 4d2d32eaf2593183f3a9056e8f6c2f72765c86c7 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 02:05:14 -0500 Subject: [PATCH 23/28] ...cmon --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5bf208ef..09799671 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,3 +7,4 @@ install: - nuget restore TravisCI.sln script: - msbuild /p:Configuration=Release TravisCI.sln + - mono ./packages/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./Tests/bin/Release/Tests.dll From b1f027ca93b9cef2b55a8a834d8fed6a01159516 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 02:12:25 -0500 Subject: [PATCH 24/28] Update Program.cs --- Console/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 5a9cab04..36289344 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -95,6 +95,6 @@ public static double Power(string x, string y) } - + } } From 93bce1aff7460bc47453f73b6dacffa73532316b Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 02:22:05 -0500 Subject: [PATCH 25/28] a --- Console/Console.csproj | 2 +- Console/Console.sln | 25 +++++++++++++++++++++++++ Console/Program.cs | 4 ++-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 Console/Console.sln diff --git a/Console/Console.csproj b/Console/Console.csproj index 26c0ed8b..4f92f043 100644 --- a/Console/Console.csproj +++ b/Console/Console.csproj @@ -1,5 +1,5 @@  - + Debug diff --git a/Console/Console.sln b/Console/Console.sln new file mode 100644 index 00000000..f86d7d9a --- /dev/null +++ b/Console/Console.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.810.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console.csproj", "{C5964EEF-DA27-4C98-B4D0-7F27767FE870}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5964EEF-DA27-4C98-B4D0-7F27767FE870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5964EEF-DA27-4C98-B4D0-7F27767FE870}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5964EEF-DA27-4C98-B4D0-7F27767FE870}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5964EEF-DA27-4C98-B4D0-7F27767FE870}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E9E65B21-FC44-473C-AF97-180CE81CA355} + EndGlobalSection +EndGlobal diff --git a/Console/Program.cs b/Console/Program.cs index 36289344..95c1807f 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -85,8 +85,8 @@ public static double Power(string x, string y) { double ret = 1; - for (int i = 0; i <= parse.Double(y); i++) { - ret *= parse.Double(x); + for (int i = 0; i <= double.Parse(y); i++) { + ret *= double.Parse(x); for (int i = 0; i <= double.Parse(y); i++) { ret *= double.Parse(x); } From 5e36e8d342d644c5b3a93edefbfcf972bce04850 Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 02:22:54 -0500 Subject: [PATCH 26/28] Update Program.cs --- Console/Program.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index 95c1807f..ec001c8f 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -87,12 +87,9 @@ public static double Power(string x, string y) double ret = 1; for (int i = 0; i <= double.Parse(y); i++) { ret *= double.Parse(x); - for (int i = 0; i <= double.Parse(y); i++) { - ret *= double.Parse(x); - } - return ret; - } + } + return ret; } } From 08f0953d08f6375c4b363d423cc42f130a4cb17a Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 02:30:02 -0500 Subject: [PATCH 27/28] Update UnitTests.cs --- Tests/UnitTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index 20cd70a9..f64d481e 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -91,7 +91,7 @@ public void Div_Null_Durante(){ [Test] public void Pow_Valid_Durante(){ Assert.AreEqual(0, Program.Power("0", "2")); - Assert.AreEqual(16, Program.Power("4", "2")); + Assert.AreEqual(64, Program.Power("4", "2")); Assert.AreEqual(9, Program.Power("3", "3")); } [Test] From 2ad7dbfd64b277ebcc0e5c2da3aa93d829371a8f Mon Sep 17 00:00:00 2001 From: Jett Date: Fri, 29 Oct 2021 02:37:45 -0500 Subject: [PATCH 28/28] Update UnitTests.cs --- Tests/UnitTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index f64d481e..149c8b5c 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -92,7 +92,7 @@ public void Div_Null_Durante(){ public void Pow_Valid_Durante(){ Assert.AreEqual(0, Program.Power("0", "2")); Assert.AreEqual(64, Program.Power("4", "2")); - Assert.AreEqual(9, Program.Power("3", "3")); + Assert.AreEqual(81, Program.Power("3", "3")); } [Test] public void Pow_Invalid_Durante(){