Skip to content

Commit

Permalink
refactor: apply canonical project structure (#128)
Browse files Browse the repository at this point in the history
Organize source code into src and tests folders. Tests are organized into unit tests and integration tests. Integration tests rely on testing against the caching service.
  • Loading branch information
malandis authored Aug 30, 2022
1 parent d9fbb9e commit d411eb8
Show file tree
Hide file tree
Showing 79 changed files with 26 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ jobs:

- name: Unit Test
run: |
dotnet test MomentoTest
dotnet test tests/Unit/Momento.Sdk.Tests
shell: bash

- name: Integration Test
run: |
dotnet test MomentoIntegrationTest
dotnet test tests/Integration/Momento.Sdk.Tests
shell: bash

- name: Incubating Integration Test
run: |
dotnet test IncubatingIntegrationTest
dotnet test tests/Integration/Momento.Sdk.Incubating.Tests
shell: bash

- name: Set release
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Pack and Publish
run: |
set -x
pushd Momento
pushd src/Momento.Sdk
VERSION="${{ steps.semrel.outputs.version }}"
echo "version: ${VERSION}"
dotnet build --configuration Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:

- name: Unit Test
run: |
dotnet test MomentoTest
dotnet test tests/Unit/Momento.Sdk.Tests
shell: bash

- name: Integration Test
run: |
dotnet test MomentoIntegrationTest
dotnet test tests/Integration/Momento.Sdk.Tests
shell: bash

- name: Incubating Integration Test
run: |
dotnet test IncubatingIntegrationTest
dotnet test tests/Integration/Momento.Sdk.Incubating.Tests
shell: bash
8 changes: 4 additions & 4 deletions Momento.sln → Momento.Sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.810.11
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MomentoSdk", "Momento\MomentoSdk.csproj", "{188A76AD-422A-4829-B59F-9EC1C102EA38}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Momento.Sdk", "src\Momento.Sdk\Momento.Sdk.csproj", "{188A76AD-422A-4829-B59F-9EC1C102EA38}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MomentoTest", "MomentoTest\MomentoTest.csproj", "{77C34767-7796-4842-BE75-20563DB3230A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Momento.Sdk.Tests.Unit", "tests\Unit\Momento.Sdk.Tests\Momento.Sdk.Tests.csproj", "{77C34767-7796-4842-BE75-20563DB3230A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MomentoIntegrationTest", "MomentoIntegrationTest\MomentoIntegrationTest.csproj", "{FB56314E-BDCF-474A-A2CD-8956934FF11B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Momento.Sdk.Tests.Integration", "tests\Integration\Momento.Sdk.Tests\Momento.Sdk.Tests.csproj", "{FB56314E-BDCF-474A-A2CD-8956934FF11B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IncubatingIntegrationTest", "IncubatingIntegrationTest\IncubatingIntegrationTest.csproj", "{A0F6221C-42A9-454B-BB82-EDB9841DF6E1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Momento.Sdk.Incubating.Tests.Integration", "tests\Integration\Momento.Sdk.Incubating.Tests\Momento.Sdk.Incubating.Tests.csproj", "{A0F6221C-42A9-454B-BB82-EDB9841DF6E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
25 changes: 0 additions & 25 deletions Momento/MomentoSdk.sln

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Build Configuration -->
<AssemblyName>Momento.Sdk</AssemblyName>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Momento.Sdk.Internal.ExtensionMethods;
using Momento.Sdk.Responses;

namespace IncubatingIntegrationTest;
namespace Momento.Sdk.Incubating.Tests;

[Collection("SimpleCacheClient")]
public class DictionaryTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace IncubatingIntegrationTest;
namespace Momento.Sdk.Incubating.Tests;

/// <summary>
/// A cache client fixture.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Momento.Sdk.Responses;

namespace IncubatingIntegrationTest;
namespace Momento.Sdk.Incubating.Tests;

[Collection("SimpleCacheClient")]
public class ListTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Momento\MomentoSdk.csproj" />
<ProjectReference Include="..\..\..\src\Momento.Sdk\Momento.Sdk.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Momento.Sdk.Responses;

namespace IncubatingIntegrationTest;
namespace Momento.Sdk.Incubating.Tests;

[Collection("SimpleCacheClient")]
public class SetTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace IncubatingIntegrationTest;
namespace Momento.Sdk.Incubating.Tests;

public class TestBase
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MomentoIntegrationTest;
namespace Momento.Sdk.Tests;

/// <summary>
/// A cache client fixture.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Momento\MomentoSdk.csproj" />
<ProjectReference Include="..\..\..\src\Momento.Sdk\Momento.Sdk.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;

namespace MomentoIntegrationTest;
namespace Momento.Sdk.Tests;

[Collection("SimpleCacheClient")]
public class SimpleCacheControlTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace MomentoIntegrationTest;
namespace Momento.Sdk.Tests;

[Collection("SimpleCacheClient")]
public class SimpleCacheDataTest
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Momento\MomentoSdk.csproj" />
<ProjectReference Include="..\..\..\src\Momento.Sdk\Momento.Sdk.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Momento.Sdk.Requests;
using Xunit;

namespace MomentoTest;
namespace Momento.Sdk.Tests;

public class MomentoSignerTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Momento.Sdk.Responses;
using Xunit;

namespace MomentoTest.Responses;
namespace Momento.Sdk.Tests.Responses;

public class CacheGetResponseTest
{
Expand Down

0 comments on commit d411eb8

Please sign in to comment.