Skip to content

Commit 6f02c19

Browse files
committed
Initial commit.
0 parents  commit 6f02c19

File tree

11 files changed

+569
-0
lines changed

11 files changed

+569
-0
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.sln.docstates
8+
9+
# Build results
10+
[Dd]ebug/
11+
[Dd]ebugPublic/
12+
[Rr]elease/
13+
x64/
14+
build/
15+
bld/
16+
[Bb]in/
17+
[Oo]bj/
18+
19+
# MSTest test Results
20+
[Tt]est[Rr]esult*/
21+
[Bb]uild[Ll]og.*
22+
23+
#NUNIT
24+
*.VisualState.xml
25+
TestResult.xml
26+
27+
# Build Results of an ATL Project
28+
[Dd]ebugPS/
29+
[Rr]eleasePS/
30+
dlldata.c
31+
32+
*_i.c
33+
*_p.c
34+
*_i.h
35+
*.ilk
36+
*.meta
37+
*.obj
38+
*.pch
39+
*.pdb
40+
*.pgc
41+
*.pgd
42+
*.rsp
43+
*.sbr
44+
*.tlb
45+
*.tli
46+
*.tlh
47+
*.tmp
48+
*.tmp_proj
49+
*.log
50+
*.vspscc
51+
*.vssscc
52+
.builds
53+
*.pidb
54+
*.svclog
55+
*.scc
56+
57+
# Chutzpah Test files
58+
_Chutzpah*
59+
60+
# Visual C++ cache files
61+
ipch/
62+
*.aps
63+
*.ncb
64+
*.opensdf
65+
*.sdf
66+
*.cachefile
67+
68+
# Visual Studio profiler
69+
*.psess
70+
*.vsp
71+
*.vspx
72+
73+
# TFS 2012 Local Workspace
74+
$tf/
75+
76+
# Guidance Automation Toolkit
77+
*.gpState
78+
79+
# ReSharper is a .NET coding add-in
80+
_ReSharper*/
81+
*.[Rr]e[Ss]harper
82+
*.DotSettings.user
83+
84+
# JustCode is a .NET coding addin-in
85+
.JustCode
86+
87+
# TeamCity is a build add-in
88+
_TeamCity*
89+
90+
# DotCover is a Code Coverage Tool
91+
*.dotCover
92+
93+
# NCrunch
94+
*.ncrunch*
95+
_NCrunch_*
96+
.*crunch*.local.xml
97+
98+
# MightyMoose
99+
*.mm.*
100+
AutoTest.Net/
101+
102+
# Web workbench (sass)
103+
.sass-cache/
104+
105+
# Installshield output folder
106+
[Ee]xpress/
107+
108+
# DocProject is a documentation generator add-in
109+
DocProject/buildhelp/
110+
DocProject/Help/*.HxT
111+
DocProject/Help/*.HxC
112+
DocProject/Help/*.hhc
113+
DocProject/Help/*.hhk
114+
DocProject/Help/*.hhp
115+
DocProject/Help/Html2
116+
DocProject/Help/html
117+
118+
# Click-Once directory
119+
publish/
120+
121+
# Publish Web Output
122+
*.[Pp]ublish.xml
123+
*.azurePubxml
124+
125+
# NuGet Packages Directory
126+
packages/
127+
## TODO: If the tool you use requires repositories.config uncomment the next line
128+
#!packages/repositories.config
129+
130+
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
131+
# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
132+
!packages/build/
133+
134+
# Windows Azure Build Output
135+
csx/
136+
*.build.csdef
137+
138+
# Windows Store app package directory
139+
AppPackages/
140+
141+
# Others
142+
sql/
143+
*.Cache
144+
ClientBin/
145+
[Ss]tyle[Cc]op.*
146+
~$*
147+
*~
148+
*.dbmdl
149+
*.dbproj.schemaview
150+
*.pfx
151+
*.publishsettings
152+
node_modules/
153+
154+
# RIA/Silverlight projects
155+
Generated_Code/
156+
157+
# Backup & report files from converting an old project file to a newer
158+
# Visual Studio version. Backup files are not needed, because we have git ;-)
159+
_UpgradeReport_Files/
160+
Backup*/
161+
UpgradeLog*.XML
162+
UpgradeLog*.htm
163+
164+
# SQL Server files
165+
*.mdf
166+
*.ldf
167+
168+
# Business Intelligence projects
169+
*.rdl.data
170+
*.bim.layout
171+
*.bim_*.settings
172+
173+
# Microsoft Fakes
174+
FakesAssemblies/
175+
176+
# =========================
177+
# Operating System Files
178+
# =========================
179+
180+
# OSX
181+
# =========================
182+
183+
.DS_Store
184+
.AppleDouble
185+
.LSOverride
186+
187+
# Icon must ends with two \r.
188+
Icon
189+
190+
# Thumbnails
191+
._*
192+
193+
# Files that might appear on external disk
194+
.Spotlight-V100
195+
.Trashes
196+
197+
# Windows
198+
# =========================
199+
200+
# Windows image file caches
201+
Thumbs.db
202+
ehthumbs.db
203+
204+
# Folder config file
205+
Desktop.ini
206+
207+
# Recycle Bin used on file shares
208+
$RECYCLE.BIN/
209+
210+
# Windows Installer files
211+
*.cab
212+
*.msi
213+
*.msm
214+
*.msp
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.IO;
5+
using System.Reflection;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
using NUnit.Framework;
9+
using TSqlFlex.SqlParser;
10+
11+
namespace TSqlFlex.SqlParser.Tests
12+
{
13+
[TestFixture()]
14+
public class ParserTests
15+
{
16+
17+
[Test()]
18+
public void CreateParser_DoesNotCrash()
19+
{
20+
SqlBatch b = new SqlBatch("");
21+
Assert.IsNotNull(b, "should be able to create batch.");
22+
}
23+
24+
[Test()]
25+
public void SqlBatch_ReturnsSameBatchTextAsPassed()
26+
{
27+
string s = Load_SimpleSelect();
28+
SqlBatch b = new SqlBatch(s);
29+
30+
Assert.AreEqual(s, b.BatchText());
31+
Assert.AreEqual(21, b.BatchText().Length, "expected this specific length because that's what is in the file.");
32+
}
33+
34+
35+
36+
private string Load_SimpleSelect()
37+
{
38+
string resourceName = "TSqlFlex.SqlParser.Tests.SqlScripts.SimpleSelect.sql";
39+
string result;
40+
Assembly assembly = Assembly.GetExecutingAssembly();
41+
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
42+
using (StreamReader reader = new StreamReader(stream))
43+
{
44+
result = reader.ReadToEnd();
45+
}
46+
return result;
47+
}
48+
}
49+
}
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("TSqlFlex.SqlParser.Tests")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("TSqlFlex.SqlParser.Tests")]
13+
[assembly: AssemblyCopyright("Copyright © 2014")]
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("1a27733c-7e5a-47f5-b9cb-93c109f0f5e6")]
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT * FROM MyTable
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C95C7CC7-59BB-4A4E-ADAE-9272BB145EC9}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>TSqlFlex.SqlParser.Tests</RootNamespace>
11+
<AssemblyName>TSqlFlex.SqlParser.Tests</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="nunit.framework">
34+
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
35+
</Reference>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="ParserTests.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="packages.config" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<ProjectReference Include="..\TSqlFlex.SqlParser\TSqlFlex.SqlParser.csproj">
53+
<Project>{7633e837-631c-49bd-9264-c9b46e1d02b8}</Project>
54+
<Name>TSqlFlex.SqlParser</Name>
55+
</ProjectReference>
56+
</ItemGroup>
57+
<ItemGroup>
58+
<EmbeddedResource Include="SqlScripts\SimpleSelect.sql" />
59+
</ItemGroup>
60+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
61+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
62+
Other similar extension points exist, see Microsoft.Common.targets.
63+
<Target Name="BeforeBuild">
64+
</Target>
65+
<Target Name="AfterBuild">
66+
</Target>
67+
-->
68+
</Project>

0 commit comments

Comments
 (0)