Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 8b42d04

Browse files
bruno-brantguilhermeluizsp
authored andcommitted
feat: corrected test for Workbench (#156)
Test "WhenUseMessageBusThenGetMessageBusReturnsSame" was not doing anything.
1 parent f312143 commit 8b42d04

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

test/Liquid.Base.Tests/Liquid.Base.Tests.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<ItemGroup>
1414
<PackageReference Include="AutoFixture.AutoNSubstitute" Version="4.11.0" />
1515
<PackageReference Include="AutoFixture.Xunit2" Version="4.11.0" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1721
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.113">
1822
<PrivateAssets>all</PrivateAssets>

test/Liquid.Base.Tests/WorkbenchTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public void WhenUseMessageBusThenGetMessageBusReturnsSame()
4343
{
4444
Workbench.Instance.UseMessageBus<MockWorker>();
4545

46-
// TODO: How to get the message bus? No shortcut?
47-
// Assert.IsAssignableFrom<MockWorker>(Workbench.Instance.);
46+
// TODO: No shortcut for the message bus... why?
47+
Assert.IsAssignableFrom<MockWorker>(Workbench.Instance.GetRegisteredService(WorkbenchServiceType.Worker));
4848
}
4949

5050
[Fact]
@@ -405,7 +405,6 @@ private class MockWorker : ILightWorker
405405
{
406406
public void Initialize()
407407
{
408-
throw new NotImplementedException();
409408
}
410409
}
411410

test/Liquid.Tests/AutoSubstituteDataAttribute.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using AutoFixture;
1+
// Copyright (c) Avanade Inc. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using AutoFixture;
25
using AutoFixture.AutoNSubstitute;
36
using AutoFixture.Xunit2;
47

@@ -27,7 +30,7 @@ public class AutoSubstituteDataAttribute : AutoDataAttribute
2730
/// Initializes a new instance of the <see cref="AutoSubstituteDataAttribute"/> class.
2831
/// </summary>
2932
public AutoSubstituteDataAttribute()
30-
: base(() => new Fixture().Customize(new AutoNSubstituteCustomization()))
33+
: base(() => new Fixture().Customize(new AutoNSubstituteCustomization()))
3134
{
3235
// empty
3336
}

0 commit comments

Comments
 (0)