Skip to content

Commit 107572a

Browse files
author
jeffshumphreys@gmail.com
committed
Yet again.
1 parent a6aa58d commit 107572a

15 files changed

+880
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("Naming", "ET002:Namespace does not match file path or default namespace", Justification = "<Pending>", Scope = "namespace", Target = "~N:MySQLCLRFunctions.Tests")]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{3D1EB882-6064-4EBA-8421-1DC11A3955E9}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MySQLCLRFunctionsTests3</RootNamespace>
11+
<AssemblyName>MySQLCLRFunctionsTests3</AssemblyName>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
16+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
17+
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
18+
<IsCodedUITest>False</IsCodedUITest>
19+
<TestProjectType>UnitTest</TestProjectType>
20+
<TargetFrameworkProfile />
21+
<NuGetPackageImportStamp>
22+
</NuGetPackageImportStamp>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25+
<DebugSymbols>true</DebugSymbols>
26+
<DebugType>full</DebugType>
27+
<Optimize>false</Optimize>
28+
<OutputPath>bin\Debug\</OutputPath>
29+
<DefineConstants>DEBUG;TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>true</Optimize>
36+
<OutputPath>bin\Release\</OutputPath>
37+
<DefineConstants>TRACE</DefineConstants>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
</PropertyGroup>
41+
<Choose>
42+
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
43+
<ItemGroup>
44+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
45+
</ItemGroup>
46+
</When>
47+
<Otherwise />
48+
</Choose>
49+
<ItemGroup>
50+
<Compile Include="GlobalSuppressions.cs" />
51+
<Compile Include="Properties\AssemblyInfo.cs" />
52+
<Compile Include="StringBuildOutTests.cs" />
53+
<Compile Include="StringDecodeTests.cs" />
54+
<Compile Include="StringExtractTests.cs" />
55+
<Compile Include="StringFormatTests.cs" />
56+
<Compile Include="StringMeasureTests.cs" />
57+
<Compile Include="StringPivotTests.cs" />
58+
<Compile Include="StringReduceTests.cs" />
59+
<Compile Include="StringTestTests.cs" />
60+
<Compile Include="StringTransformStripDownCustomizationsTests.cs" />
61+
<Compile Include="StringTransformTests.cs" />
62+
<Compile Include="StringTransformTSQLSpecificTests.cs" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<None Include="packages.config" />
66+
</ItemGroup>
67+
<ItemGroup>
68+
<ProjectReference Include="..\MySQLCLRFunctions.csproj">
69+
<Project>{6AEAE0BF-82E7-4793-8E9D-E649ABD0A807}</Project>
70+
<Name>MySQLCLRFunctions</Name>
71+
</ProjectReference>
72+
</ItemGroup>
73+
<ItemGroup>
74+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
75+
<Private>False</Private>
76+
</Reference>
77+
</ItemGroup>
78+
<Choose>
79+
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
80+
<ItemGroup>
81+
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
82+
<Private>False</Private>
83+
</Reference>
84+
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
85+
<Private>False</Private>
86+
</Reference>
87+
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
88+
<Private>False</Private>
89+
</Reference>
90+
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
91+
<Private>False</Private>
92+
</Reference>
93+
</ItemGroup>
94+
</When>
95+
</Choose>
96+
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
97+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
98+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
99+
<PropertyGroup>
100+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
101+
</PropertyGroup>
102+
<Error Condition="!Exists('..\..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props'))" />
103+
<Error Condition="!Exists('..\..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets'))" />
104+
</Target>
105+
<Import Project="..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\MySQLCLRFunctions\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" />
106+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
107+
Other similar extension points exist, see Microsoft.Common.targets.
108+
<Target Name="BeforeBuild">
109+
</Target>
110+
<Target Name="AfterBuild">
111+
</Target>
112+
-->
113+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("MySQLCLRFunctionsTests3")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("MySQLCLRFunctionsTests3")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("3d1eb882-6064-4eba-8421-1dc11a3955e9")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using MySQLCLRFunctions;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace MySQLCLRFunctions.Tests
10+
{
11+
[TestClass()]
12+
public class StringBuildOutTests
13+
{
14+
[TestMethod()]
15+
public void AppendWithSeparatorTest()
16+
{
17+
Assert.Fail();
18+
}
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using MySQLCLRFunctions;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace MySQLCLRFunctions.Tests
10+
{
11+
[TestClass()]
12+
public class StringDecodeTests
13+
{
14+
[TestMethod()]
15+
public void RevealNonPrintablesTest()
16+
{
17+
Assert.Fail();
18+
}
19+
}
20+
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using MySQLCLRFunctions;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace MySQLCLRFunctions.Tests
10+
{
11+
[TestClass()]
12+
public class StringExtractTests
13+
{
14+
[TestMethod()]
15+
public void LeftOfTest()
16+
{
17+
Assert.Fail();
18+
}
19+
20+
[TestMethod()]
21+
public void LeftOfNthTest()
22+
{
23+
Assert.Fail();
24+
}
25+
26+
[TestMethod()]
27+
public void LeftMOfNthTest()
28+
{
29+
Assert.Fail();
30+
}
31+
[TestMethod()]
32+
public void LeftOfAnyTest()
33+
{
34+
Assert.Fail();
35+
}
36+
37+
[TestMethod()]
38+
public void RightOfTest()
39+
{
40+
Assert.Fail();
41+
}
42+
43+
[TestMethod()]
44+
public void RightOfAnyTest()
45+
{
46+
Assert.Fail();
47+
}
48+
49+
[TestMethod()]
50+
public void MidTest()
51+
{
52+
var input = "GetTHEMIDDLEofthis";
53+
var validoutput = "THEMIDDLE";
54+
var output = StringExtract.Mid(input, 4, 12);
55+
Assert.AreEqual(expected: validoutput, output);
56+
}
57+
58+
[TestMethod()]
59+
public void MidTest_OverloadBySign()
60+
{
61+
var input = "GetTHEMIDDLEofthis";
62+
var validoutput = "th";
63+
var output = StringExtract.Mid(input, -4, -2);
64+
Assert.AreEqual(expected: validoutput, output);
65+
}
66+
67+
[TestMethod()]
68+
public void GetFirstNameTest()
69+
{
70+
var input = "Jeff Humphreys";
71+
var validoutput = "Jeff";
72+
var output = StringExtract.GetFirstName(input);
73+
Assert.AreEqual(expected: validoutput, output);
74+
}
75+
76+
[TestMethod()]
77+
public void GetFirstNameTest2()
78+
{
79+
var input = "Humphreys, Jeff";
80+
var validoutput = "Jeff";
81+
var output = StringExtract.GetFirstName(input);
82+
Assert.AreEqual(expected: validoutput, output);
83+
}
84+
85+
[TestMethod()]
86+
public void GetFirstNameTest3()
87+
{
88+
var input = "Humphreys, Jeff S.";
89+
var validoutput = "Jeff";
90+
var output = StringExtract.GetFirstName(input);
91+
Assert.AreEqual(expected: validoutput, output);
92+
}
93+
94+
[TestMethod()]
95+
public void LeftTest()
96+
{
97+
var input = "Humphreys, Jeff S.";
98+
var validoutput = "Hum";
99+
var output = StringExtract.Left(input, 3);
100+
Assert.AreEqual(expected: validoutput, output);
101+
}
102+
103+
[TestMethod()]
104+
public void FirstWordTest()
105+
{
106+
var input = "Humphreys, Jeff S.";
107+
var validoutput = "Humphreys";
108+
var output = StringExtract.FirstWord(input);
109+
Assert.AreEqual(expected: validoutput, output);
110+
}
111+
112+
[TestMethod()]
113+
public void PieceNumberTest()
114+
{
115+
var input = "Humphreys, Jeff S.";
116+
var validoutput = "Humphreys";
117+
var output = StringExtract.PieceNumber(input, ",", 1);
118+
Assert.AreEqual(expected: validoutput, output);
119+
}
120+
121+
[TestMethod()]
122+
public void LastPieceTest()
123+
{
124+
var input = "Humphreys, Jeff S.";
125+
var validoutput = " Jeff S.";
126+
var output = StringExtract.LastPiece(input, ",");
127+
Assert.AreEqual(expected: validoutput, output);
128+
}
129+
130+
[TestMethod()]
131+
public void FirstWordBeforeSTest()
132+
{
133+
var input = "Humphreys, Jeff S.";
134+
var validoutput = "Humphreys, ";
135+
var output = StringExtract.FirstWordBeforeS(input, @"Je");
136+
Assert.AreEqual(expected: validoutput, output);
137+
}
138+
139+
[TestMethod()]
140+
public void FirstWordBeforeAnyCTest()
141+
{
142+
var input = "Humphreys, Jeff S.";
143+
var validoutput = "Humphr";
144+
var output = StringExtract.FirstWordBeforeAnyC(input, @"e,.");
145+
Assert.AreEqual(expected: validoutput, output);
146+
}
147+
148+
[TestMethod()]
149+
public void EverythingAfterXTest()
150+
{
151+
var input = "Humphreys, Jeff S.";
152+
var validoutput = " Jeff S.";
153+
var output = StringExtract.EverythingAfterX(input, @",");
154+
Assert.AreEqual(expected: validoutput, output);
155+
}
156+
}
157+
}

0 commit comments

Comments
 (0)