Skip to content

Commit

Permalink
Potential test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cobya committed Sep 27, 2024
1 parent e490022 commit 7c0a94a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageVersion Include="MSTest.TestFramework" Version="3.5.1" />
<PackageVersion Include="MSTest.Analyzers" Version="3.5.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.5.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Newtonsoft.Json.Schema" Version="3.0.16" />
<PackageVersion Include="NuGet.ProjectModel" Version="6.10.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public void SerializableProperties()
{
foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
if (!serializableTypes.Contains(property.PropertyType) &&
Attribute.GetCustomAttribute(property.PropertyType, typeof(DataContractAttribute)) == null)
if (!serializableTypes.Contains(property.PropertyType))
{
Attribute.GetCustomAttribute(property.PropertyType, typeof(DataContractAttribute)).Should().NotBeNull(

Check warning on line 70 in test/Microsoft.ComponentDetection.Common.Tests/BaseDetectionTelemetryRecordTests.cs

View check run for this annotation

Codecov / codecov/patch

test/Microsoft.ComponentDetection.Common.Tests/BaseDetectionTelemetryRecordTests.cs#L70

Added line #L70 was not covered by tests
$"Type {property.PropertyType} on {type.Name}.{property.Name} is not allowed! " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
<NoWarn>$(NoWarn);NU1504;NU1105</NoWarn>
</PropertyGroup>

<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

<ItemGroup>
<!--<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<!--<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
IF TESTING LOCALLY, UNCOMMENT ABOVE AND COMMENT BELOW -->
Expand Down

0 comments on commit 7c0a94a

Please sign in to comment.