Skip to content

Commit

Permalink
Develop (#77)
Browse files Browse the repository at this point in the history
* feat(lifecycle-hook-base): added base classes for lifecycle hook and startup #56

* feat(lifecycle-hook-base): added extension points #56

* feat(lifecycle-hook-base): put extensibility into base bootstrapper #56

* feat(lifecycle-override): injecting before scenario override #56 (#58)

* refactor: added framework-agnostic scenario data store base class #62 (#65)

* Feature/scenario context current remove (#68)

* feat(scenario-context): removed scenario context #49

* feat(scenario-context): added end to end scenario data store #49

* feat(integration-middleware): added integration-tests related middlewares #49

* feat(integration-middleware): added extension methods #49

* feat(set-value): added SetValue method #71 (#75)

* feat(data-store-namespace): moved data store classes to Context namespace #73 (#76)
  • Loading branch information
godrose authored Jun 2, 2021
1 parent ae5aeff commit ae478aa
Show file tree
Hide file tree
Showing 58 changed files with 133 additions and 102 deletions.
2 changes: 1 addition & 1 deletion Attest.Fake.Builders/Attest.Fake.Builders.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Conventions/Attest.Fake.Conventions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Core/Attest.Fake.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Data/Attest.Fake.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.FakeItEasy/Attest.Fake.FakeItEasy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.LightMock/Attest.Fake.LightMock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Moq.Specs/Attest.Fake.Moq.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="SpecFlow" Version="3.8.14" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.8.35" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.8.14" />
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Moq/Attest.Fake.Moq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Registration/Attest.Fake.Registration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
4 changes: 2 additions & 2 deletions Attest.Fake.Setup.Extensions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.2.1")]
[assembly: AssemblyFileVersion("2.2.1")]
[assembly: AssemblyVersion("2.2.2")]
[assembly: AssemblyFileVersion("2.2.2")]
2 changes: 1 addition & 1 deletion Attest.Fake.Setup.Specs/Attest.Fake.Setup.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="SpecFlow" Version="3.8.14" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.8.35" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.8.14" />
Expand Down
2 changes: 1 addition & 1 deletion Attest.Fake.Setup/Attest.Fake.Setup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.Contracts/Attest.Testing.Contracts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.Core.Specs/Attest.Testing.Core.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="Solid.Common.Core" Version="2.3.0" />
<PackageReference Include="SpecFlow" Version="3.8.14" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.8.35" />
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.Core/Attest.Testing.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ReSharper disable once CheckNamespace
namespace Attest.Testing.DataStore
namespace Attest.Testing.Context
{
/// <summary>
/// Represents a key-value data store.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Solid.Practices.IoC;

// ReSharper disable once CheckNamespace
namespace Attest.Testing.DataStore
namespace Attest.Testing.Context
{
/// <summary>
/// Represents data store for integration tests with root object.
Expand All @@ -21,29 +21,29 @@ public RootObjectScenarioDataStore(IKeyValueDataStore keyValueDataStore)

internal IDependencyRegistrator Registrator
{
get => GetValueImpl<IDependencyRegistrator>();
set => SetValueImpl(value);
get => GetValue<IDependencyRegistrator>();
set => SetValue(value);
}

internal IDependencyResolver Resolver
{
get => GetValueImpl<IDependencyResolver>();
set => SetValueImpl(value);
get => GetValue<IDependencyResolver>();
set => SetValue(value);
}

internal IRootObjectFactory RootObjectFactory
{
get => GetValueImpl<IRootObjectFactory>();
set => SetValueImpl(value);
get => GetValue<IRootObjectFactory>();
set => SetValue(value);
}

/// <summary>
/// Gets the root object.
/// </summary>
public object RootObject
{
get => GetValueImpl<object>();
internal set => SetValueImpl(value);
get => GetValue<object>();
internal set => SetValue(value);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Runtime.CompilerServices;
using System;
using System.Runtime.CompilerServices;

// ReSharper disable once CheckNamespace
namespace Attest.Testing.DataStore
namespace Attest.Testing.Context
{
/// <summary>
/// Base class for scenario data stores.
Expand Down Expand Up @@ -29,6 +30,23 @@ protected ScenarioDataStoreBase(IKeyValueDataStore keyValueDataStore)
/// <param name="defaultValue">The default value.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
protected T GetValue<T>(T defaultValue = default, [CallerMemberName] string key = default)
{
return GetValueImpl(defaultValue, key);
}

/// <summary>
/// Gets stored value by the specified key.
/// Returns the specified default value if the value cannot be found using the specified key.
/// If no default value is specified then the default value for the type is returned.
/// This method is deprecated and will be removed in the next major release.
/// Use <see cref="GetValue{T}"/> instead.
/// </summary>
/// <typeparam name="T">The type of the value.</typeparam>
/// <param name="defaultValue">The default value.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
[Obsolete]
protected T GetValueImpl<T>(T defaultValue = default, [CallerMemberName] string key = default)
{
var coercedKey = Coerce(key);
Expand All @@ -41,6 +59,20 @@ protected T GetValueImpl<T>(T defaultValue = default, [CallerMemberName] string
/// <typeparam name="T">The type of the value.</typeparam>
/// <param name="value">The value.</param>
/// <param name="key">The key.</param>
protected void SetValue<T>(T value, [CallerMemberName] string key = default)
{
SetValueImpl(value, key);
}

/// <summary>
/// Sets value using the specified key.
/// This method is deprecated and will be removed in the next major release.
/// Use <see cref="SetValue{T}"/> instead.
/// </summary>
/// <typeparam name="T">The type of the value.</typeparam>
/// <param name="value">The value.</param>
/// <param name="key">The key.</param>
[Obsolete]
protected void SetValueImpl<T>(T value, [CallerMemberName] string key = default)
{
var coercedKey = Coerce(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;

// ReSharper disable once CheckNamespace
namespace Attest.Testing.DataStore
namespace Attest.Testing.Context
{
/// <summary>
/// Simple implementation of <see cref="IKeyValueDataStore"/> using <see cref="Dictionary{TKey,TValue}"/>.
Expand Down
14 changes: 7 additions & 7 deletions Attest.Testing.Core/EndToEnd/EndToEndScenarioDataStore.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Attest.Testing.Contracts;
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using Attest.Testing.Contracts;

// ReSharper disable once CheckNamespace
namespace Attest.Testing.EndToEnd
Expand All @@ -10,7 +10,7 @@ namespace Attest.Testing.EndToEnd
public class EndToEndScenarioDataStore : ScenarioDataStoreBase
{
/// <summary>
/// Initializes a new instanc eof <see cref="EndToEndScenarioDataStore"/>
/// Initializes a new instance of <see cref="EndToEndScenarioDataStore"/>
/// </summary>
/// <param name="keyValueDataStore"></param>
public EndToEndScenarioDataStore(IKeyValueDataStore keyValueDataStore)
Expand All @@ -23,17 +23,17 @@ public EndToEndScenarioDataStore(IKeyValueDataStore keyValueDataStore)
/// </summary>
public IStartApplicationService StartApplicationService
{
get => GetValueImpl<IStartApplicationService>();
set => SetValueImpl(value);
get => GetValue<IStartApplicationService>();
set => SetValue(value);
}

/// <summary>
/// Gets or sets the builder registration service.
/// </summary>
public IBuilderRegistrationService BuilderRegistrationService
{
get => GetValueImpl<IBuilderRegistrationService>();
set => SetValueImpl(value);
get => GetValue<IBuilderRegistrationService>();
set => SetValue(value);
}
}
}
4 changes: 2 additions & 2 deletions Attest.Testing.Core/Integration/RegistratorExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Attest.Testing.Contracts;
using Attest.Testing.Context;
using Attest.Testing.Contracts;
using Attest.Testing.Core;
using Attest.Testing.DataStore;
using Solid.Practices.IoC;

// ReSharper disable once CheckNamespace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Attest.Testing.Context;
using Attest.Testing.Contracts;
using Attest.Testing.Core;
using Attest.Testing.DataStore;

// ReSharper disable once CheckNamespace
namespace Attest.Testing.Integration
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.Core/ScenarioHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using Solid.Practices.IoC;

namespace Attest.Testing.Core
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.NUnit/Attest.Testing.NUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.NUnit/EndToEndTestsBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using NUnit.Framework;

namespace Attest.Testing.NUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using NUnit.Framework;
using NUnit.Framework.Interfaces;

Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.NUnit/UseKeyValueDataStoreMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using Solid.Bootstrapping;
using Solid.Practices.IoC;
using Solid.Practices.Middleware;
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.SpecFlow/Attest.Testing.SpecFlow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\netstandard\Release\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Attest.Testing.SpecFlow/RegistratorExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using Solid.Practices.IoC;

namespace Attest.Testing.SpecFlow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Attest.Testing.DataStore;
using Attest.Testing.Context;
using TechTalk.SpecFlow;

namespace Attest.Testing.SpecFlow
Expand Down
Loading

0 comments on commit ae478aa

Please sign in to comment.