Skip to content

Commit 5355a66

Browse files
author
jeffshumphreys@gmail.com
committed
Added stubs for tests.
1 parent 139d782 commit 5355a66

36 files changed

+492
-162
lines changed

CharacterExtract.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ public static class CharacterExtract
1515
* WARNING: Empty string is not a character!
1616
*
1717
***************************************************************************************************************************************************************************************************/
18-
public static char? FirstC(this string input)
18+
internal static char? FIRSTC(this string input)
19+
{
20+
if (StringTest.IsNullOrEmpty(input)) return null; // Empty string is not a character!
21+
22+
return input[0];
23+
}
24+
25+
public static char? FirstC(string input)
1926
{
2027
if (StringTest.IsNullOrEmpty(input)) return null; // Empty string is not a character!
2128

CharacterTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ namespace MySQLCLRFunctions
77
{
88
public static class CharacterTest
99
{
10-
public static bool? NotInX(this char? input, string pattern)
10+
public static bool? NotInX(char? input, string pattern)
1111
{
1212
if (input == null) return null;
1313
if (IsNull(pattern)) throw new ArgumentNullException("pattern cannot be null");
1414
if (IsEmpty(pattern)) throw new ArgumentNullException("pattern cannot be empty. characters cannot contain and empty string. Get over it.");
1515

1616
return Regex.IsMatch(input.ToString(), pattern);
1717
}
18+
19+
internal static bool? NOTINX(this char? input, string pattern)
20+
{
21+
return NotInX(input, pattern);
22+
}
1823
}
19-
}
24+
}

CharacterTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace MySQLCLRFunctions
88
{
99
public static class CharacterTransform
1010
{
11-
public static string ReplaceFirstC(this string input, char replacement)
11+
public static string ReplaceFirstC(string input, char replacement)
1212
{
1313
if (IsNullOrEmpty(input)) return input;
1414

@@ -19,7 +19,7 @@ public static string ReplaceFirstC(this string input, char replacement)
1919
return replacement + LTrimOne(input);
2020
}
2121

22-
public static string ReplaceLastC(this string input, char replacement)
22+
public static string ReplaceLastC(string input, char replacement)
2323
{
2424
if (IsNullOrEmpty(input)) return input;
2525

Environmental.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
namespace MySQLCLRFunctions
55
{
6+
/*************************************************************************
7+
*
8+
* These don't work, but they can be changed to call actual sound functions.
9+
*
10+
*************************************************************************/
611
public static class Environmental
712
{
813
[SqlFunction(DataAccess = DataAccessKind.None)]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.Adaptors;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class AdaptorsTests
7+
{
8+
[Fact()]
9+
public void VarBin2HexTest()
10+
{
11+
// VarBin2Hex
12+
Assert.True(false, "This test needs an implementation");
13+
}
14+
15+
[Fact()]
16+
public void ADDateTimeString2DateTimeTest()
17+
{
18+
Assert.True(false, "This test needs an implementation");
19+
}
20+
}
21+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.AssemblyTools;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class AssemblyToolsTests
7+
{
8+
[Fact()]
9+
public void SaveAssemblyTest()
10+
{
11+
Assert.True(false, "This test needs an implementation");
12+
}
13+
}
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.CharacterExtract;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class CharacterExtractTests
7+
{
8+
[Fact()]
9+
[PositiveTest]
10+
public void FirstCTest()
11+
{
12+
const string input = "~NBK";
13+
char? validoutput = '~';
14+
char? output = FirstC(input);
15+
Assert.Equal(expected: validoutput, actual: output);
16+
}
17+
}
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.CharacterTest;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class CharacterTestTests
7+
{
8+
[Fact()]
9+
public void NotInXTest()
10+
{
11+
const char input = 'a';
12+
const string pattern = "[Adb]";
13+
bool? output = NotInX(input, pattern);
14+
Assert.True(output);
15+
}
16+
}
17+
}

MySQLCLRFunctionsTests/CharacterTransformTests.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using Xunit;
2-
using MySQLCLRFunctions;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
2+
using static MySQLCLRFunctions.CharacterTransform;
83

94
namespace MySQLCLRFunctions.Tests
105
{
@@ -16,7 +11,7 @@ public void ReplaceFirstCTest()
1611
{
1712
const string input = "Jeff Humphreys";
1813
const string validoutput = "Heff Humphreys";
19-
var output = CharacterTransform.ReplaceFirstC(input, 'H');
14+
var output = ReplaceFirstC(input, 'H');
2015
Assert.Equal(expected: validoutput, output);
2116
}
2217

@@ -26,7 +21,7 @@ public void ReplaceLastCTest()
2621
{
2722
const string input = "Jeff Humphreys";
2823
const string validoutput = "Jeff Humphreyz";
29-
var output = CharacterTransform.ReplaceLastC(input, 'z');
24+
var output = ReplaceLastC(input, 'z');
3025
Assert.Equal(expected: validoutput, output);
3126
}
3227
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.Compares;
3+
4+
5+
namespace MySQLCLRFunctions.Tests
6+
{
7+
public class ComparesTests
8+
{
9+
[Fact()]
10+
public void Max2DateTimesTest()
11+
{
12+
13+
Assert.True(false, "This test needs an implementation");
14+
}
15+
16+
[Fact()]
17+
public void Max3DateTimesTest()
18+
{
19+
Assert.True(false, "This test needs an implementation");
20+
}
21+
22+
[Fact()]
23+
public void Max4DateTimesTest()
24+
{
25+
Assert.True(false, "This test needs an implementation");
26+
}
27+
28+
[Fact()]
29+
public void Max2IntegersTest()
30+
{
31+
Assert.True(false, "This test needs an implementation");
32+
}
33+
34+
[Fact()]
35+
public void Max3IntegersTest()
36+
{
37+
Assert.True(false, "This test needs an implementation");
38+
}
39+
40+
[Fact()]
41+
public void Max4IntegersTest()
42+
{
43+
Assert.True(false, "This test needs an implementation");
44+
}
45+
46+
[Fact()]
47+
public void Max2BigIntsTest()
48+
{
49+
Assert.True(false, "This test needs an implementation");
50+
}
51+
52+
[Fact()]
53+
public void Max3BigIntsTest()
54+
{
55+
Assert.True(false, "This test needs an implementation");
56+
}
57+
58+
[Fact()]
59+
public void Max4BigIntsTest()
60+
{
61+
Assert.True(false, "This test needs an implementation");
62+
}
63+
64+
[Fact()]
65+
public void Min2DateTimesTest()
66+
{
67+
Assert.True(false, "This test needs an implementation");
68+
}
69+
70+
[Fact()]
71+
public void Min3DateTimesTest()
72+
{
73+
Assert.True(false, "This test needs an implementation");
74+
}
75+
76+
[Fact()]
77+
public void Min4DateTimesTest()
78+
{
79+
Assert.True(false, "This test needs an implementation");
80+
}
81+
82+
[Fact()]
83+
public void Min2IntegersTest()
84+
{
85+
Assert.True(false, "This test needs an implementation");
86+
}
87+
88+
[Fact()]
89+
public void Min3IntegersTest()
90+
{
91+
Assert.True(false, "This test needs an implementation");
92+
}
93+
94+
[Fact()]
95+
public void Min4IntegersTest()
96+
{
97+
Assert.True(false, "This test needs an implementation");
98+
}
99+
100+
[Fact()]
101+
public void Min2BigIntsTest()
102+
{
103+
Assert.True(false, "This test needs an implementation");
104+
}
105+
106+
[Fact()]
107+
public void Min3BigIntsTest()
108+
{
109+
Assert.True(false, "This test needs an implementation");
110+
}
111+
112+
[Fact()]
113+
public void Min4BigIntsTest()
114+
{
115+
Assert.True(false, "This test needs an implementation");
116+
}
117+
}
118+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.Environmental;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class EnvironmentalTests
7+
{
8+
[Fact()]
9+
public void BeepStandardTest()
10+
{
11+
Assert.True(false, "This test needs an implementation");
12+
}
13+
14+
[Fact()]
15+
public void BeepTest()
16+
{
17+
Assert.True(false, "This test needs an implementation");
18+
}
19+
}
20+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.FileNameExtract;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class FileNameExtractTests
7+
{
8+
[Fact()]
9+
public void FileNameExtensionTest()
10+
{
11+
Assert.True(false, "This test needs an implementation");
12+
}
13+
14+
[Fact()]
15+
public void FileNameWithoutExtensionTest()
16+
{
17+
Assert.True(false, "This test needs an implementation");
18+
}
19+
20+
[Fact()]
21+
public void IsLegalFileNameTest()
22+
{
23+
Assert.True(false, "This test needs an implementation");
24+
}
25+
26+
[Fact()]
27+
public void FileNameWithExtensionTest()
28+
{
29+
Assert.True(false, "This test needs an implementation");
30+
}
31+
32+
[Fact()]
33+
public void FileInDirectoryTest()
34+
{
35+
Assert.True(false, "This test needs an implementation");
36+
}
37+
38+
[Fact()]
39+
public void FileInFolderTest()
40+
{
41+
Assert.True(false, "This test needs an implementation");
42+
}
43+
}
44+
}

MySQLCLRFunctionsTests/FilesTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Xunit;
2+
using static MySQLCLRFunctions.Files;
3+
4+
namespace MySQLCLRFunctions.Tests
5+
{
6+
public class FilesTests
7+
{
8+
[Fact()]
9+
public void TempFilePathTest()
10+
{
11+
Assert.True(false, "This test needs an implementation");
12+
}
13+
}
14+
}

MySQLCLRFunctionsTests/HumanizationTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using Xunit;
2-
using static MySQLCLRFunctions.Tests._MyAssertFunctions;
3-
using MySQLCLRFunctions;
4-
using System;
1+
using System;
2+
using Xunit;
53

64
// TODO: Convert to Xunit: Assert.Throws<InvalidOperationException>(() => operation()); // VS 2008
75
namespace MySQLCLRFunctions.Tests

0 commit comments

Comments
 (0)