Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Commit

Permalink
amend: cleanup and nuspec fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMentzel committed Mar 3, 2017
2 parents ffbf8aa + 0268b2f commit acd86ce
Show file tree
Hide file tree
Showing 38 changed files with 290 additions and 203 deletions.
89 changes: 0 additions & 89 deletions NSuggest.ElasticSearch/NSuggest.ElasticSearch.csproj

This file was deleted.

36 changes: 0 additions & 36 deletions NSuggest.ElasticSearch/Properties/AssemblyInfo.cs

This file was deleted.

9 changes: 0 additions & 9 deletions NSuggest.ElasticSearch/packages.config

This file was deleted.

26 changes: 26 additions & 0 deletions NSuggest.WPF/AutoCompleteManager_Should.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Threading;
using System.Windows.Controls;
using FluentAssertions;
using NEdifis.Attributes;
using NUnit.Framework;

namespace NSuggest.WPF
{
[TestFixtureFor(typeof(AutoCompleteManager))]
// ReSharper disable InconsistentNaming
internal class AutoCompleteManager_Should
{
[Test]
[Apartment(ApartmentState.STA)]
public void Be_Creatable()
{
0.Invoking(x => new AutoCompleteManager(null)).ShouldThrow<ArgumentNullException>();

Assert.Inconclusive("TODO");

var textBox = new TextBox();
var sut = new AutoCompleteManager(textBox);
}
}
}
19 changes: 19 additions & 0 deletions NSuggest.WPF/NSuggest.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="NEdifis, Version=0.7.0.0, Culture=neutral, PublicKeyToken=68bd55412466663d, processorArchitecture=MSIL">
<HintPath>..\packages\NEdifis.0.7.0\lib\net45\NEdifis.dll</HintPath>
</Reference>
<Reference Include="NSubstitute, Version=2.0.2.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.2.0.2\lib\net45\NSubstitute.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
Expand All @@ -55,12 +70,15 @@
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="AutoCompleteComboBox.cs" />
<Compile Include="AutoCompleteManager_Should.cs" />
<Compile Include="AutoCompleteTextBox.cs" />
<Compile Include="AutoCompleteManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
Expand All @@ -87,6 +105,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Package.nuspec" />
<None Include="packages.config" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions NSuggest.WPF/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<releaseNotes>Revision: $Revision$</releaseNotes>
<projectUrl>https://github.com/awesome-inc/NSuggest.WPF</projectUrl>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Net.Http" targetFramework="" />
<frameworkAssembly assemblyName="WindowsBase" targetFramework="" />
<frameworkAssembly assemblyName="PresentationCore" targetFramework="" />
<frameworkAssembly assemblyName="PresentationFramework" targetFramework="" />
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions NSuggest.WPF/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.19.0" targetFramework="net452" />
<package id="GitVersionTask" version="3.6.5" targetFramework="net452" developmentDependency="true" />
<package id="NEdifis" version="0.7.0" targetFramework="net452" />
<package id="NSubstitute" version="2.0.2" targetFramework="net452" />
<package id="NUnit" version="3.6.1" targetFramework="net452" />
<package id="OneClickBuild" version="1.11.2" targetFramework="net452" developmentDependency="true" />
</packages>
6 changes: 0 additions & 6 deletions NSuggest.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
SolutionInfo.cs = SolutionInfo.cs
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NSuggest.ElasticSearch", "NSuggest.ElasticSearch\NSuggest.ElasticSearch.csproj", "{D4DCC047-342C-49B3-8D08-FAB7AD639DB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -47,10 +45,6 @@ Global
{F72E1C17-8685-48AB-8FF5-88D8E0DAE78E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F72E1C17-8685-48AB-8FF5-88D8E0DAE78E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F72E1C17-8685-48AB-8FF5-88D8E0DAE78E}.Release|Any CPU.Build.0 = Release|Any CPU
{D4DCC047-342C-49B3-8D08-FAB7AD639DB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4DCC047-342C-49B3-8D08-FAB7AD639DB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4DCC047-342C-49B3-8D08-FAB7AD639DB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4DCC047-342C-49B3-8D08-FAB7AD639DB1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 1 addition & 6 deletions NSuggest/Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using System.Linq;
using System.Threading;

// ReSharper disable CheckNamespace
namespace NSuggest
// ReSharper restore CheckNamespace
{
/// <summary>
/// A generic thread-safe lru-cache.
Expand Down Expand Up @@ -575,10 +573,7 @@ public void ResetStatistics()
public override string ToString()
{
//return base.ToString();
return String.Format("Cur/Max = {0}/{1}, Hit/Miss = {2}/{3} ({4}%)",
Count, Capacity,
CacheHits, CacheMisses,
State);
return $"Cur/Max = {Count}/{Capacity}, Hit/Miss = {CacheHits}/{CacheMisses} ({State}%)";
}
}
}
27 changes: 27 additions & 0 deletions NSuggest/Cache_Should.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Linq;
using FluentAssertions;
using NEdifis.Attributes;
using NUnit.Framework;

namespace NSuggest
{
[TestFixtureFor(typeof(Cache<int, int>))]
// ReSharper disable InconsistentNaming
internal class Cache_Should
{
[Test]
public void Skip_lru_items()
{
const int maxSize = 5;
var sut = new Cache<int, int>(maxSize);
Enumerable.Range(0, maxSize).ToList().ForEach(i =>
{
sut.Add(i, i);
sut.ContainsKey(i).Should().BeTrue();
});

sut.Add(maxSize,maxSize);
sut.ContainsKey(0).Should().BeFalse("lru item should be bumped from cache");
}
}
}
38 changes: 38 additions & 0 deletions NSuggest/NSuggest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,52 @@
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Json, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.Json.4.19.0\lib\net45\FluentAssertions.Json.dll</HintPath>
</Reference>
<Reference Include="NEdifis, Version=0.7.0.0, Culture=neutral, PublicKeyToken=68bd55412466663d, processorArchitecture=MSIL">
<HintPath>..\packages\NEdifis.0.7.0\lib\net45\NEdifis.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NSubstitute, Version=2.0.2.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.2.0.2\lib\net45\NSubstitute.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="BlackList.cs" />
<Compile Include="Cache.cs" />
<Compile Include="Cache_Should.cs" />
<Compile Include="IHaveKeyedValues.cs" />
<Compile Include="IHaveKeyStrings.cs" />
<Compile Include="ISuffixTree.cs" />
<Compile Include="Rest\ElasticSearchSuggestions.cs" />
<Compile Include="Rest\ElasticSearchSuggestions_Should.cs" />
<Compile Include="Rest\HttpClientWrapper.cs" />
<Compile Include="Rest\HttpClientWrapper_Should.cs" />
<Compile Include="Rest\IHookHttpRequest.cs" />
<Compile Include="Rest\IHttpClient.cs" />
<Compile Include="Rest\IRestClient.cs" />
<Compile Include="Rest\JsonExtensions.cs" />
<Compile Include="Rest\RestClient.cs" />
<Compile Include="Rest\RestClient_Should.cs" />
<Compile Include="Rest\RestExtensions.cs" />
<Compile Include="Rest\TestData.cs" />
<Compile Include="SuggestionsProxy.cs" />
<Compile Include="KeyedValuesProxy.cs" />
<Compile Include="TernarySearchTree`1.cs" />
Expand All @@ -66,6 +103,7 @@
<Compile Include="IProvideSuggestions.cs" />
<Compile Include="RegistrySuggestions.cs" />
<Compile Include="StaticDataSuggestions.cs" />
<None Include="app.config" />
<None Include="packages.config" />
<None Include="UrlHistorySuggestions.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using Newtonsoft.Json.Linq;

namespace NSuggest.ElasticSearch
namespace NSuggest.Rest
{
public class ElasticSearchSuggestions : IProvideSuggestions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using NEdifis.Attributes;
using NUnit.Framework;

namespace NSuggest.ElasticSearch
namespace NSuggest.Rest
{
[TestFixtureFor(typeof(ElasticSearchSuggestions))]
// ReSharper disable once InconsistentNaming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Net.Http;
using System.Threading.Tasks;

namespace NSuggest.ElasticSearch
namespace NSuggest.Rest
{
public class HttpClientWrapper : IHttpClient
{
Expand Down

0 comments on commit acd86ce

Please sign in to comment.