Cleanup code

This commit is contained in:
jvyden 2021-10-20 00:19:29 -04:00
parent 8ad04860ee
commit 685f57fd28
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 6 additions and 3 deletions

View file

@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -8,6 +9,7 @@ using ProjectLighthouse.Serialization;
using ProjectLighthouse.Types; using ProjectLighthouse.Types;
namespace ProjectLighthouse.Tests { namespace ProjectLighthouse.Tests {
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public class LighthouseTest { public class LighthouseTest {
public readonly TestServer Server; public readonly TestServer Server;
public readonly HttpClient Client; public readonly HttpClient Client;

View file

@ -4,11 +4,10 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using ProjectLighthouse.Types; using ProjectLighthouse.Types;
using Xunit; using Xunit;
using Xunit.Abstractions;
namespace ProjectLighthouse.Tests { namespace ProjectLighthouse.Tests {
public class MatchTests : LighthouseTest { public class MatchTests : LighthouseTest {
private static SemaphoreSlim semaphore = new(1, 1); private static readonly SemaphoreSlim semaphore = new(1, 1);
[DatabaseFact] [DatabaseFact]
public async Task ShouldReturnOk() { public async Task ShouldReturnOk() {

View file

@ -31,7 +31,7 @@ namespace ProjectLighthouse {
this.Locations.Add(l); // add to table this.Locations.Add(l); // add to table
await this.SaveChangesAsync(); // saving to the database returns the id and sets it on this entity await this.SaveChangesAsync(); // saving to the database returns the id and sets it on this entity
user = new() { user = new User {
Username = username, Username = username,
LocationId = l.Id, LocationId = l.Id,
Biography = username + " hasn't introduced themselves yet.", Biography = username + " hasn't introduced themselves yet.",

View file

@ -1,9 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace ProjectLighthouse.Helpers { namespace ProjectLighthouse.Helpers {
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public static class HashHelper { public static class HashHelper {
// private static readonly SHA1 sha1 = SHA1.Create(); // private static readonly SHA1 sha1 = SHA1.Create();
private static readonly SHA256 sha256 = SHA256.Create(); private static readonly SHA256 sha256 = SHA256.Create();