Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename NetStandard projects #136

Merged
merged 7 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ test_script:
#
# Also use -oldStyle flag which uses an alternate instrumentation hook that is available for .NET Core
# Some comments on this can be found here: https://github.com/OpenCover/opencover/issues/601
- .\tools\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:dotnet.exe -targetargs:"test --logger \"trx;LogFileName=netstandard_test_results.xml\" .\Keen.NetStandard.Test\Keen.NetStandard.Test.csproj /property:DebugType=Full" -mergeoutput -output:coverage.xml -filter:"+[*]* -[*.Test]* -[Moq*]*" -oldStyle -returntargetcode -register:user
- .\tools\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:dotnet.exe -targetargs:"test --logger \"trx;LogFileName=dotnetcore_test_results.xml\" .\Keen.Test\Keen.Test.csproj /property:DebugType=Full" -mergeoutput -output:coverage.xml -filter:"+[*]* -[*.Test]* -[Moq*]*" -oldStyle -returntargetcode -register:user

# Upload coverage results
- .\tools\coveralls.net.0.8.0-unstable0013\tools\csmacnz.Coveralls.exe --opencover -i .\coverage.xml

# Upload netstandard test results to appveyor
- ps: (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\Keen.NetStandard.Test\TestResults\netstandard_test_results.xml))
- ps: (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\Keen.Test\TestResults\dotnetcore_test_results.xml))

#---------------------------------#
# notifications #
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dist: trusty
# The image to use for the osx build
osx_image: xcode8.3

# Build and run the Keen.NetStandard project and run its tests
# Build and run the Keen project and run its tests
script: |
cd Keen.NetStandard.Test
cd Keen.Test
dotnet test
4 changes: 0 additions & 4 deletions Keen.NetStandard/Properties/AssenblyInfo.cs

This file was deleted.

29 changes: 27 additions & 2 deletions Keen.NetStandard.Test/AddOnsTest.cs → Keen.Test/AddOnsTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using System.Collections.Generic;
using Keen.Core.DataEnrichment;
using Keen.Core;
using Keen.DataEnrichment;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class AddOnsTest : TestBase
Expand All @@ -14,12 +15,16 @@ public void No_AddOn_Success()
{
var client = new KeenClient(SettingsEnv);
if (UseMocks)
{
client.EventCollection = new EventCollectionMock(SettingsEnv,
addEvent: (c, e, p) =>
{
if (e["keen"].ToString().Contains("keen:ip_to_geo"))
{
throw new Exception("Unexpected values");
}
});
}

Assert.DoesNotThrow(() => client.AddEvent("AddOnTest", new { an_ip = "70.187.8.97" }));
}
Expand All @@ -29,12 +34,16 @@ public void IpToGeo_Send_Success()
{
var client = new KeenClient(SettingsEnv);
if (UseMocks)
{
client.EventCollection = new EventCollectionMock(SettingsEnv,
addEvent: (c, e, p) =>
{
if (!e["keen"].ToString().Contains("keen:ip_to_geo"))
{
throw new Exception("Unexpected values");
}
});
}

var a = AddOn.IpToGeo("an_ip", "geocode");

Expand All @@ -46,12 +55,16 @@ public void IpToGeo_MissingInput_Throws()
{
var client = new KeenClient(SettingsEnv);
if (UseMocks)
{
client.EventCollection = new EventCollectionMock(SettingsEnv,
addEvent: (c, e, p) =>
{
if (!e["keen"].ToString().Contains("\"ip\": \"an_ip\""))
{
throw new KeenException("Unexpected values");
}
});
}

var a = AddOn.IpToGeo("wrong_field", "geocode");

Expand All @@ -64,12 +77,16 @@ public void UserAgentParser_Send_Success()
{
var client = new KeenClient(SettingsEnv);
if (UseMocks)
{
client.EventCollection = new EventCollectionMock(SettingsEnv,
addEvent: (c, e, p) =>
{
if (!e["keen"].ToString().Contains("keen:ua_parser"))
{
throw new Exception("Unexpected values");
}
});
}

var a = AddOn.UserAgentParser("user_agent_string", "user_agent_parsed");

Expand All @@ -81,12 +98,16 @@ public void UrlParser_Send_Success()
{
var client = new KeenClient(SettingsEnv);
if (UseMocks)
{
client.EventCollection = new EventCollectionMock(SettingsEnv,
addEvent: (c, e, p) =>
{
if (!e["keen"].ToString().Contains("keen:url_parser"))
{
throw new Exception("Unexpected values");
}
});
}

var a = AddOn.UrlParser("url", "url_parsed");

Expand All @@ -98,12 +119,16 @@ public void ReferrerParser_Send_Success()
{
var client = new KeenClient(SettingsEnv);
if (UseMocks)
{
client.EventCollection = new EventCollectionMock(SettingsEnv,
addEvent: (c, e, p) =>
{
if (!e["keen"].ToString().Contains("keen:referrer_parser"))
{
throw new Exception("Unexpected values");
}
});
}

var a = AddOn.ReferrerParser("referrer", "page", "referrer_parsed");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Keen.Core.Dataset;
using Keen.Core.Query;
using Keen.Core;
using Keen.Dataset;
using Keen.Query;
using Moq;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class DatasetTests : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Keen.Core.Dataset;
using Keen.Core.Query;
using Keen.Core;
using Keen.Dataset;
using Keen.Query;
using Moq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class DatasetTests_Integration : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;


namespace Keen.Core.Test
namespace Keen.Test
{
/// <summary>
/// Wraps an <see cref="IHttpMessageHandler"/> and allows for using it as a DelegatingHandler.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Threading.Tasks;
using Keen.Core;


namespace Keen.Core.Test
namespace Keen.Test
{
class EventCachePortableTestable : EventCachePortable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Keen.Core.EventCache;
using Keen.Core;
using Keen.EventCache;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class EventCacheTests : TestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Threading.Tasks;
using Keen.Core;
using Newtonsoft.Json.Linq;


namespace Keen.Core.Test
namespace Keen.Test
{
/// <summary>
/// EventCollectionMock provides an implementation of IEventCollection with a
Expand Down
5 changes: 3 additions & 2 deletions Keen.NetStandard.Test/EventMock.cs → Keen.Test/EventMock.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Keen.Core.EventCache;
using Keen.Core;
using Keen.EventCache;
using Newtonsoft.Json.Linq;


namespace Keen.Core.Test
namespace Keen.Test
{
/// <summary>
/// EventMock provides an implementation of IEvent with a constructor that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;


namespace Keen.Core.Test
namespace Keen.Test
{
/// <summary>
/// An <see cref="IHttpMessageHandler"/> that has pre/post/default message handlers functors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Keen.Core.Query;
using Keen.Core;
using Keen.Query;
using Moq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class FunnelTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;


namespace Keen.Core.Test
namespace Keen.Test
{
/// <summary>
/// Wraps an <see cref="IHttpMessageHandler"/> and allows for using it as an HttpClientHandler.
Expand Down
5 changes: 3 additions & 2 deletions Keen.NetStandard.Test/HttpTests.cs → Keen.Test/HttpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Keen.Core.Query;
using Keen.Core;
using Keen.Query;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
internal class HttpTests : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;


namespace Keen.Core
namespace Keen.Test
{
/// <summary>
/// Represents the main functionality needed to override both HttpClientHandler and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
<ItemGroup Condition=" '$(DebugType)' == 'Full' ">
<PackageReference Include="Mono.Cecil" Version="0.10.0-beta6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Keen.NetStandard\Keen.NetStandard.csproj" />
<ProjectReference Include="..\Keen\Keen.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using System.Dynamic;
using System.Linq;
using System.Threading.Tasks;
using Keen.Core.EventCache;
using Keen.Core;
using Keen.EventCache;
using Moq;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class BulkEventTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using Keen.Core;
using Newtonsoft.Json;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
class ProjectSettingsProviderTest
Expand Down
5 changes: 3 additions & 2 deletions Keen.NetStandard.Test/QueryTest.cs → Keen.Test/QueryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
using System.Dynamic;
using System.Linq;
using System.Threading.Tasks;
using Keen.Core.Query;
using Keen.Core;
using Keen.Query;
using Moq;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class QueryTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Keen.Core.Query;
using Keen.Core;
using Keen.Query;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
/// <summary>
/// Integration tests for Queries. These will exercise more than unit tests, like the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using Keen.Core;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
namespace Keen.Test
{
[TestFixture]
public class ScopedKeyTest : TestBase
Expand Down
Loading