This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from GoEddie/UniqueTests
visual studio 2017 version
- Loading branch information
Showing
18 changed files
with
209 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
AgileSQLClub.tSQLtTestController/Properties/Settings.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using AgileSQLClub.tSQLtTestController; | ||
using Moq; | ||
using NUnit.Framework; | ||
using tSQLtTestAdapter; | ||
|
||
namespace UnitTests | ||
{ | ||
[TestFixture] | ||
public class TestCacheTests | ||
{ | ||
[Test] | ||
public void DiscardsDuplicates() | ||
{ | ||
var mockScanner = new Mock<FileScanner>(); | ||
|
||
mockScanner.Setup(p => p.ScanCode(It.IsAny<string>(), It.IsAny<ScanResults>(), It.IsAny<string>())).Returns(( | ||
string a, ScanResults result, string b) => | ||
{ | ||
result.FoundClasses.Add(new SqlSchema("Schema", "PathA")); | ||
result.FoundClasses.Add(new SqlSchema("Schema", "PathB")); | ||
result.FoundClasses.Add(new SqlSchema("Schema", "PathB")); | ||
|
||
result.FoundPotentialTests.Add(new SqlProcedure(new SqlObjectName() {Object = "test", Schema = "Schema"}, "Patha", 0, 100, 1)); | ||
result.FoundPotentialTests.Add(new SqlProcedure(new SqlObjectName() { Object = "test", Schema = "Schema" }, "Pathb", 0, 100, 1)); | ||
return result; | ||
}); | ||
|
||
var mockFileReader = new Mock<IFileReader>(); | ||
mockFileReader.Setup(p => p.ReadAll(It.IsAny<string>())).Returns("Blah"); | ||
mockFileReader.Setup(p => p.GetLastWriteTimeUtc(It.IsAny<string>())).Returns(DateTime.MaxValue); | ||
|
||
var testCache = new TestCache(mockScanner.Object, mockFileReader.Object); | ||
testCache.AddPath("path"); | ||
Assert.AreEqual(1, testCache.GetTests().Count); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Castle.Core" version="4.0.0" targetFramework="net452" /> | ||
<package id="Microsoft.SqlServer.DacFx.x64" version="130.3411.1" targetFramework="net452" /> | ||
<package id="Moq" version="4.7.1" targetFramework="net452" /> | ||
<package id="NUnit" version="3.2.1" targetFramework="net452" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011"> | ||
<Metadata> | ||
<Identity Id="AgileSQLClub.tSQLtTestAdapter" Version="0.63" Language="en-US" Publisher="EdElliott" /> | ||
<DisplayName>tSQLt Test Adapter</DisplayName> | ||
<Identity Id="AgileSQLClub.tSQLtTestAdapter15" Version="0.80" Language="en-US" Publisher="EdElliott" /> | ||
<DisplayName>tSQLt Test Adapter for Visual Studio 2017</DisplayName> | ||
<Description xml:space="preserve">Unit Test Adapter for tSQLt Tests</Description> | ||
<MoreInfo>https://the.agilsql.club/projects/tSQLt-Test-Adapter</MoreInfo> | ||
<License>LICENSE</License> | ||
<Tags>tSQLt, Test, Adapter</Tags> | ||
</Metadata> | ||
<Installation> | ||
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0,15.0)" /> | ||
<InstallationTarget Version="[14.0,15.0)" Id="Microsoft.VisualStudio.Ultimate" /> | ||
<InstallationTarget Version="[14.0,15.0)" Id="Microsoft.VisualStudio.Premium" /> | ||
|
||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Pro" /> | ||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Ultimate" /> | ||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Community" /> | ||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" /> | ||
</Installation> | ||
<Dependencies> | ||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.5" /> | ||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.6" /> | ||
</Dependencies> | ||
<Assets> | ||
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="tSQLtTestAdapter" Path="|tSQLtTestAdapter|" /> | ||
<Asset Type="UnitTestExtension" d:Source="Project" d:ProjectName="tSQLtTestAdapter" Path="|tSQLtTestAdapter|" /> | ||
<Asset Type="Microsoft.VisualStudio.Assembly" d:Source="Project" d:ProjectName="AgileSQLClub.tSQLtTestController" Path="|AgileSQLClub.tSQLtTestController|" AssemblyName="|AgileSQLClub.tSQLtTestController;AssemblyName|" /> | ||
</Assets> | ||
<Prerequisites> | ||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" /> | ||
</Prerequisites> | ||
</PackageManifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace tSQLtTestAdapter | ||
{ | ||
public interface IFileReader | ||
{ | ||
DateTime GetLastWriteTimeUtc(string path); | ||
string ReadAll(string path); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.