chore: Use var everywhere (#2294)
This commit is contained in:
parent
0b34cc4417
commit
ebaf104935
267 changed files with 873 additions and 873 deletions
|
|
@ -74,7 +74,7 @@ public class EventSchedulerTests
|
|||
|
||||
try
|
||||
{
|
||||
bool called = false;
|
||||
var called = false;
|
||||
var evt = EventScheduler.Shared.ScheduleEvent(
|
||||
Core._now,
|
||||
TimeOnly.FromDateTime(Core._now),
|
||||
|
|
@ -154,7 +154,7 @@ public class EventSchedulerTests
|
|||
|
||||
try
|
||||
{
|
||||
int callCount = 0;
|
||||
var callCount = 0;
|
||||
|
||||
// Create a recurrence pattern that fires every 10 seconds, up to 3 times
|
||||
var recurrence = new TestRecurrencePattern(TimeSpan.FromSeconds(10), 3);
|
||||
|
|
@ -191,8 +191,8 @@ public class EventSchedulerTests
|
|||
|
||||
try
|
||||
{
|
||||
bool failedEventCalled = false;
|
||||
bool laterEventCalled = false;
|
||||
var failedEventCalled = false;
|
||||
var laterEventCalled = false;
|
||||
|
||||
// Event that throws exception
|
||||
var failedEvt = EventScheduler.Shared.ScheduleEvent(
|
||||
|
|
@ -234,7 +234,7 @@ public class EventSchedulerTests
|
|||
|
||||
try
|
||||
{
|
||||
bool eventCalled = false;
|
||||
var eventCalled = false;
|
||||
|
||||
var evt = EventScheduler.Shared.ScheduleEvent(
|
||||
Core._now.AddSeconds(10),
|
||||
|
|
@ -264,7 +264,7 @@ public class EventSchedulerTests
|
|||
|
||||
try
|
||||
{
|
||||
int callCount = 0;
|
||||
var callCount = 0;
|
||||
|
||||
// Create a recurrence pattern that fires every 10 seconds
|
||||
var recurrence = new TestRecurrencePattern(TimeSpan.FromSeconds(10));
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class PartyPacketTests
|
|||
[Fact]
|
||||
public void TestPartyEmptyList()
|
||||
{
|
||||
Serial m = (Serial)0x1024u;
|
||||
var m = (Serial)0x1024u;
|
||||
|
||||
var expected = new PartyEmptyList(m).Compile();
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ public class PartyPacketTests
|
|||
[InlineData(false)]
|
||||
public void TestPartyTextMessage(bool toAll)
|
||||
{
|
||||
Serial serial = (Serial)0x1024u;
|
||||
var serial = (Serial)0x1024u;
|
||||
var text = "[Party] Stuff Happens";
|
||||
|
||||
var expected = new PartyTextMessage(toAll, serial, text).Compile();
|
||||
|
|
@ -85,7 +85,7 @@ public class PartyPacketTests
|
|||
[Fact]
|
||||
public void TestPartyInvitation()
|
||||
{
|
||||
Serial m = (Serial)0x1024u;
|
||||
var m = (Serial)0x1024u;
|
||||
|
||||
var expected = new PartyInvitation(m).Compile();
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class BookPacketTests
|
|||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
Serial serial = (Serial)0x1001;
|
||||
var serial = (Serial)0x1001;
|
||||
var book = new TestBook(serial) { Author = author, Title = title };
|
||||
|
||||
var expected = new BookHeader(m, book).Compile();
|
||||
|
|
@ -60,7 +60,7 @@ public class BookPacketTests
|
|||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
Serial serial = (Serial)0x1001;
|
||||
var serial = (Serial)0x1001;
|
||||
var book = new TestBook(serial) { Author = "Some Author", Title = "Some Title" };
|
||||
book.Pages[0].Lines = new[]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class MahjongPacketTests
|
|||
[Fact]
|
||||
public void TestMahjongJoinGame()
|
||||
{
|
||||
Serial game = (Serial)0x1024u;
|
||||
var game = (Serial)0x1024u;
|
||||
|
||||
var expected = new MahjongJoinGame(game).Compile();
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ public class MahjongPacketTests
|
|||
[Fact]
|
||||
public void TestMahjongRelieve()
|
||||
{
|
||||
Serial game = (Serial)0x1024u;
|
||||
var game = (Serial)0x1024u;
|
||||
|
||||
var expected = new MahjongRelieve(game).Compile();
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class HousePacketTests
|
|||
[Fact]
|
||||
public void TestHouseDesignStateDetailed()
|
||||
{
|
||||
Serial serial = (Serial)0x40000001;
|
||||
var serial = (Serial)0x40000001;
|
||||
var revision = 10;
|
||||
var tiles = new MultiTileEntry[250];
|
||||
for (var i = 0; i < tiles.Length; i++)
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ public sealed class DesignStateDetailed : Packet
|
|||
|
||||
++planeCount;
|
||||
|
||||
int size = i switch
|
||||
var size = i switch
|
||||
{
|
||||
0 => width * height * 2,
|
||||
< 5 => (width - 1) * (height - 2) * 2,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class ArrowPacketTests
|
|||
[InlineData(100000, 100000)]
|
||||
public void TestCancelArrowHS(int x, int y)
|
||||
{
|
||||
Serial serial = (Serial)0x1024;
|
||||
var serial = (Serial)0x1024;
|
||||
|
||||
var expected = new CancelArrowHS(x, y, serial).Compile();
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class ArrowPacketTests
|
|||
[InlineData(100000, 100000)]
|
||||
public void TestSetArrowHS(int x, int y)
|
||||
{
|
||||
Serial serial = (Serial)0x1024;
|
||||
var serial = (Serial)0x1024;
|
||||
|
||||
var expected = new SetArrowHS(x, y, serial).Compile();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class BuffIconPacketTests
|
|||
[Fact]
|
||||
public void TestRemoveBuffIcon()
|
||||
{
|
||||
Serial m = (Serial)0x1024;
|
||||
var m = (Serial)0x1024;
|
||||
var buffIcon = BuffIcon.Disguised;
|
||||
var expected = new RemoveBuffPacket(m, buffIcon).Compile();
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public class TryParseTests
|
|||
[InlineData("Alakazam", "Not a valid boolean string.", true)]
|
||||
public void TestTryParseBool(string value, string returned, bool parsedAs)
|
||||
{
|
||||
string actualReturned = Server.Types.TryParse(typeof(bool), value, out object constructed);
|
||||
var actualReturned = Server.Types.TryParse(typeof(bool), value, out var constructed);
|
||||
Assert.Equal(returned, actualReturned);
|
||||
|
||||
if (returned == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue