expand test coverage: TelemetryChannel (#2361)

* test coverage

* csproj changes

* fix compiler errors

* include TelemetryChannel project.
Move Test TargetFrameworks to Test.props

* fix

* fix

* cleanup test projects

* fix

* cleanup

* cleanup merge conflict

* cleanup

* save progress

* worker service finished

* cleanup

* cleanup
This commit is contained in:
Timothy Mothra 2021-08-26 14:35:07 -07:00 коммит произвёл GitHub
Родитель 99b87a135c
Коммит 8861b2cec0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 15 добавлений и 8 удалений

Просмотреть файл

@ -1,4 +1,4 @@
#if NET461 || NETCOREAPP
#if !NET452 && !NET46
namespace Microsoft.ApplicationInsights.TestFramework.Helpers
{
using System;

Просмотреть файл

@ -6,10 +6,12 @@
[TestClass]
public class WebEventSourceTest
{
#if !NET5_0 // TODO: WHY DOES THIS NOT WORK?
[TestMethod]
public void MethodsAreImplementedConsistentlyWithTheirAttributes()
{
EventSourceTest.MethodsAreImplementedConsistentlyWithTheirAttributes(TelemetryChannelEventSource.Log);
}
#endif
}
}

Просмотреть файл

@ -3,9 +3,8 @@
<PropertyGroup>
<!-- TargetFrameworks are defined in Test.props, but can be overridden here if needed. -->
<TargetFrameworks>net452;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">net452;net46;net461;$(TargetFrameworks)</TargetFrameworks>
<AssemblyName>Microsoft.ApplicationInsights.TelemetryChannel.Tests</AssemblyName>
</PropertyGroup>
@ -18,20 +17,26 @@
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<ItemGroup Condition="'$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net46' ">
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net46' Or '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or '$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net480' ">
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.71" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web.Extensions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition=" '$(TargetFramework)' != 'net452' And '$(TargetFramework)' != 'net46' ">
<PackageReference Include="Azure.Core" Version="1.14.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0' ">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>