Skip to content

Commit

Permalink
Resolve warnings (#207)
Browse files Browse the repository at this point in the history
+semver:patch
  • Loading branch information
hazzik authored Oct 17, 2022
1 parent 0d6f563 commit c53911d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public EfTestDbContext() : base(GetConnectionString()) { }
#if NETCOREAPP
static string GetConnectionString()
{
var location = new Uri(typeof(EfTestDbContext).Assembly.EscapedCodeBase).LocalPath;
var location = new Uri(typeof(EfTestDbContext).Assembly.Location).LocalPath;
var configuration = ConfigurationManager.OpenExeConfiguration(location);
var connectionString = configuration.ConnectionStrings.ConnectionStrings["DelegateDecompilerEfTestDb"]
.ConnectionString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public void ComputedShouldThrowExceptionIfUnsupportedMemberInfo()

class TestClass
{
public int Field;
public int Property { get { return Field; } }
public int Field = 1;

public int Property => Field;

public int Method()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static string GetMarkupFileDirectory(string alternateTestDir = MarkupDire
{
string path;
if (GetMarkupFileDirectory(Environment.CurrentDirectory, alternateTestDir, out path) ||
GetMarkupFileDirectory(Path.GetDirectoryName(new Uri(typeof(MarkupFileHelpers).Assembly.CodeBase).LocalPath), alternateTestDir, out path))
GetMarkupFileDirectory(Path.GetDirectoryName(new Uri(typeof(MarkupFileHelpers).Assembly.Location).LocalPath), alternateTestDir, out path))
{
return path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void ComputedShouldThrowExceptionIfUnsupportedMemberInfo()

class TestClass
{
public int Field;
public int Field = 1;
public int Property { get { return Field; } }

public int Method()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
Expand Down Expand Up @@ -30,6 +31,7 @@ public virtual TResult ExecuteAsync<TResult>(Expression expression, Cancellation
return AsyncQueryProvider.ExecuteAsync<TResult>(decompiled, cancellationToken);
}

[SuppressMessage("EntityFramework", "EF1001")]
public override IQueryable<TElement> CreateQuery<TElement>(Expression expression)
{
var decompiled = expression.Decompile();
Expand Down
4 changes: 2 additions & 2 deletions src/DelegateDecompiler.Tests/AbstractMethodTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class C<T> : A

public class D : C<int>
{
public string Me = "C";
public new string Me = "C";

public override string M1() => "D";

Expand All @@ -112,7 +112,7 @@ public class D : C<int>

public abstract class E : C<int>
{
public string Me = "C";
public new string Me = "C";

public override string M1() => "E";

Expand Down
3 changes: 2 additions & 1 deletion src/DelegateDecompiler.Tests/BooleanTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#pragma warning disable CS0162 // Code is unreachable
using System;
using System.Linq.Expressions;
using NUnit.Framework;

Expand Down
4 changes: 3 additions & 1 deletion src/DelegateDecompiler.Tests/NullTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// ReSharper disable EqualExpressionComparison
#pragma warning disable CS1718 // Comparison made to same variable
using System;
using System.Linq.Expressions;
using NUnit.Framework;

Expand Down
2 changes: 2 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<TreatWarningsAsErrors>True</TreatWarningsAsErrors>

<ContinuousIntegrationBuild Condition="'$(CI)' != ''">$(CI)</ContinuousIntegrationBuild>
</PropertyGroup>

Expand Down

0 comments on commit c53911d

Please sign in to comment.