Skip to content

Commit

Permalink
Reference Be.Stateless.Unit + code analysis issue mitigations
Browse files Browse the repository at this point in the history
reference common.unit
bump up nugets
refresh git submodules
align to nuget runtime and utilities nuget refactoring to avoid ODX compiler warnings
  • Loading branch information
François Chabot committed Jan 8, 2021
1 parent 499f017 commit fe67a45
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .build
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule ".build"]
path = .build
url = https://github.com/icraftsoftware/Be.Stateless.Build.Scripts.git
[submodule ".settings"]
path = .settings
url = https://github.com/icraftsoftware/Be.Stateless.Editor.Config.git
[submodule ".build"]
path = .build
url = https://github.com/icraftsoftware/Be.Stateless.Build.Scripts.git
2 changes: 1 addition & 1 deletion .settings
1 change: 1 addition & 0 deletions Be.Stateless.BizTalk.Explorer.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=FileAD76E8C2C25CED47A6FA160551990498/RelativePriority/@EntryValue">4</s:Double>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Chabot/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Fran_00E7ois/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MSBTS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unenlist/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unenlisted/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unenlisting/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BizTalk.Server.2020.Runtime" Version="1.0.3">
<PackageReference Include="Be.Stateless.Common.Unit" Version="2.0.21005.39505" />
<PackageReference Include="BizTalk.Server.2020.Runtime" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="BizTalk.Server.2020.Utilities" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -17,8 +22,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="xunit.core" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
28 changes: 0 additions & 28 deletions src/Be.Stateless.BizTalk.Explorer.Tests/DelegateFactory.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
using FluentAssertions;
using Microsoft.BizTalk.ExplorerOM;
using Xunit;
using static Be.Stateless.DelegateFactory;
using static Be.Stateless.Unit.DelegateFactory;

namespace Be.Stateless.BizTalk.Management
{
[SuppressMessage("ReSharper", "AccessToDisposedClosure")]
public class OrchestrationFixture : IDisposable
{
[SuppressMessage("ReSharper", "InvertIf")]
public OrchestrationFixture()
{
if (BizTalkServerGroup.IsConfigured)
Expand All @@ -42,6 +43,7 @@ public OrchestrationFixture()

#region IDisposable Members

[SuppressMessage("ReSharper", "InvertIf")]
public void Dispose()
{
if (BizTalkServerGroup.IsConfigured)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
</PropertyGroup>

<PropertyGroup>
<!-- https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#system-variables -->
<ContinuousIntegrationBuild Condition="'$(TF_BUILD)' == 'true'">true</ContinuousIntegrationBuild>
<Deterministic>true</Deterministic>
<GeneratePackageOnBuild Condition=" '$(GeneratePackageOnBuild)' == '' ">false</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<PackageId>$(AssemblyTitle)</PackageId>
Expand All @@ -41,18 +38,22 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Be.Stateless.Extensions" Version="2.0.20224.33378" />
<PackageReference Include="BizTalk.Server.2020.Runtime" Version="1.0.3">
<PackageReference Include="Be.Stateless.Extensions" Version="2.0.21005.38790" />
<PackageReference Include="BizTalk.Server.2020.Runtime" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="log4net" Version="2.0.9" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PackageReference Include="BizTalk.Server.2020.Utilities" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="log4net" Version="2.0.12" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.Management" Version="4.7.0" />
<PackageReference Include="System.Management" Version="5.0.0" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/Be.Stateless.BizTalk.Explorer/Explorer/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using BizTalkApplication = Microsoft.BizTalk.ExplorerOM.Application;

namespace Be.Stateless.BizTalk.Explorer
{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global", Justification = "Public API.")]
public sealed class Application : IDisposable
{
public Application(BizTalkApplication application, ApplicationCollection applicationCollection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
using System;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Be.Stateless.Extensions;

namespace Be.Stateless.BizTalk.Explorer
{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
public class BizTalkServerManagementDatabase
{
public BizTalkServerManagementDatabase(string server, string database)
Expand Down
3 changes: 3 additions & 0 deletions src/Be.Stateless.BizTalk.Explorer/Explorer/Orchestration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.BizTalk.ExplorerOM;

namespace Be.Stateless.BizTalk.Explorer
{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API.")]
public class Orchestration
{
public Orchestration(BtsOrchestration orchestration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.BizTalk.ExplorerOM;

namespace Be.Stateless.BizTalk.Explorer
Expand All @@ -28,6 +29,7 @@ public OrchestrationCollection(BtsOrchestrationCollection orchestrations)
BizTalkOrchestrationCollection = orchestrations ?? throw new ArgumentNullException(nameof(orchestrations));
}

[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API.")]
public Orchestration this[string name]
{
get
Expand Down
4 changes: 4 additions & 0 deletions src/Be.Stateless.BizTalk.Explorer/Explorer/ReceiveLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using BizTalkReceiveLocation = Microsoft.BizTalk.ExplorerOM.ReceiveLocation;

namespace Be.Stateless.BizTalk.Explorer
{
[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API.")]
public class ReceiveLocation
{
public ReceiveLocation(BizTalkReceiveLocation location)
{
BizTalkReceiveLocation = location ?? throw new ArgumentNullException(nameof(location));
}

[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
public bool Enabled
{
get => BizTalkReceiveLocation.Enable;
Expand All @@ -36,6 +39,7 @@ public bool Enabled

public string Name => BizTalkReceiveLocation.Name;

[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Local", Justification = "Public API.")]
private BizTalkReceiveLocation BizTalkReceiveLocation { get; set; }

public void Disable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using BizTalkReceiveLocationCollection = Microsoft.BizTalk.ExplorerOM.ReceiveLocationCollection;

namespace Be.Stateless.BizTalk.Explorer
Expand All @@ -28,6 +29,7 @@ public ReceiveLocationCollection(BizTalkReceiveLocationCollection locations)
BizTalkReceiveLocationCollection = locations ?? throw new ArgumentNullException(nameof(locations));
}

[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API.")]
public ReceiveLocation this[string name]
{
get
Expand Down
3 changes: 3 additions & 0 deletions src/Be.Stateless.BizTalk.Explorer/Explorer/ReceivePort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using BizTalkReceivePort = Microsoft.BizTalk.ExplorerOM.ReceivePort;

namespace Be.Stateless.BizTalk.Explorer
{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global", Justification = "Public API.")]
public class ReceivePort
{
public ReceivePort(BizTalkReceivePort port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using BizTalkReceivePortCollection = Microsoft.BizTalk.ExplorerOM.ReceivePortCollection;

namespace Be.Stateless.BizTalk.Explorer
Expand All @@ -28,6 +29,7 @@ public ReceivePortCollection(BizTalkReceivePortCollection ports)
BizTalkReceivePortCollection = ports ?? throw new ArgumentNullException(nameof(ports));
}

[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API.")]
public ReceivePort this[string name]
{
get
Expand Down
3 changes: 3 additions & 0 deletions src/Be.Stateless.BizTalk.Explorer/Explorer/SendPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.BizTalk.ExplorerOM;
using BizTalkSendPort = Microsoft.BizTalk.ExplorerOM.SendPort;

namespace Be.Stateless.BizTalk.Explorer
{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
public class SendPort
{
public SendPort(BizTalkSendPort port)
Expand All @@ -42,6 +44,7 @@ public void Start()
if (Status != PortStatus.Started) Status = PortStatus.Started;
}

[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API.")]
public void Stop()
{
if (Status != PortStatus.Stopped) Status = PortStatus.Stopped;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#endregion

using System;
using System.Diagnostics.CodeAnalysis;
using BizTalkSendPortCollection = Microsoft.BizTalk.ExplorerOM.SendPortCollection;

namespace Be.Stateless.BizTalk.Explorer
Expand All @@ -41,6 +42,7 @@ public SendPortCollection(BizTalkSendPortCollection ports)
}
}

[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Local", Justification = "Public API.")]
private BizTalkSendPortCollection BizTalkSendPortCollection { get; set; }
}
}
21 changes: 10 additions & 11 deletions src/Be.Stateless.BizTalk.Explorer/Management/Orchestration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,12 @@ public OrchestrationStatus Status
get
{
var status = _managementObject["OrchestrationStatus"];
switch (status.ToString())
{
case "2":
return OrchestrationStatus.Unenlisted;
case "3":
return OrchestrationStatus.Enlisted;
case "4":
return OrchestrationStatus.Started;
default:
throw new InvalidOperationException("Unknown WMI OrchestrationStatus.");
}
return status.ToString() switch {
"2" => OrchestrationStatus.Unenlisted,
"3" => OrchestrationStatus.Enlisted,
"4" => OrchestrationStatus.Started,
_ => throw new InvalidOperationException("Unknown WMI OrchestrationStatus.")
};
}
}

Expand All @@ -92,13 +87,15 @@ private ManagementPath ManagementPath
}
}

[SuppressMessage("ReSharper", "VirtualMemberNeverOverridden.Global", Justification = "Dispose pattern.")]
protected virtual void Dispose(bool disposing)
{
if (_isDisposed) return;
if (disposing) _managementObject?.Dispose();
_isDisposed = true;
}

[SuppressMessage("ReSharper", "InvertIf")]
public void EnsureStarted()
{
_logger.Debug($"Ensuring orchestration '{_orchestrationType.FullName}' is started.");
Expand All @@ -109,6 +106,7 @@ public void EnsureStarted()
}
}

[SuppressMessage("ReSharper", "MemberCanBePrivate.Global", Justification = "Public API.")]
public void EnsureNotStarted()
{
_logger.Debug($"Ensuring orchestration '{_orchestrationType.FullName}' is not started.");
Expand All @@ -118,6 +116,7 @@ public void EnsureNotStarted()
}
}

[SuppressMessage("ReSharper", "InvertIf")]
public void EnsureUnenlisted()
{
_logger.Debug($"Ensuring orchestration '{_orchestrationType.FullName}' is unenlisted.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

#endregion

using System.Diagnostics.CodeAnalysis;
using Microsoft.BizTalk.XLANGs.BTXEngine;

namespace Be.Stateless.BizTalk.Management
{
[SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Public API.")]
public class Orchestration<T> : Orchestration
where T : BTXService
{
Expand Down

0 comments on commit fe67a45

Please sign in to comment.