Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump MSTest.TestAdapter from 3.6.4 to 3.7.0 #296

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@

<ItemGroup Condition="$(MSBuildProjectName.EndsWith('Tests'))">
<PackageReference Include="FluentAssertions" Version="7.0.0"/>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4"/>
<PackageReference Include="MSTest.TestFramework" Version="3.6.4"/>
<PackageReference Include="MSTest.TestAdapter" Version="3.7.1"/>
<PackageReference Include="MSTest.TestFramework" Version="3.7.1"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageReference Include="Moq" Version="[4.18.4]"/>
<PackageReference Include="coverlet.collector" Version="6.0.3"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void GetListTest()
{
int i = 10;

IList<int> ints = i.GetList();
List<int> ints = i.GetList();

Assert.AreEqual(i + 1, ints.Count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void CreateAllDrugsTest()
drugs = DomainFactory.CreateAllDrugs();

Assert.IsNotNull(drugs);
Assert.IsTrue(drugs.Any());
Assert.AreNotEqual(0, drugs.Count);
}

[TestMethod]
Expand Down
7 changes: 2 additions & 5 deletions tests/LSDW.Domain.Tests/Models/Base/BindablePropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@
Assert.AreEqual(oldValue, testClass.TestProperty.Value);
}

private sealed class TestClass
private sealed class TestClass(string testProperty)
{
public TestClass(string testProperty)
=> TestProperty = new BindableProperty<string>(testProperty);

public IBindableProperty<string> TestProperty { get; set; }
public IBindableProperty<string> TestProperty { get; set; } = new BindableProperty<string>(testProperty);

Check warning on line 57 in tests/LSDW.Domain.Tests/Models/Base/BindablePropertyTests.cs

View workflow job for this annotation

GitHub Actions / build

Change type of property 'TestProperty' from 'LSDW.Abstractions.Domain.Models.Base.IBindableProperty<string>' to 'LSDW.Domain.Models.Base.BindableProperty<string>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)

Check warning on line 57 in tests/LSDW.Domain.Tests/Models/Base/BindablePropertyTests.cs

View workflow job for this annotation

GitHub Actions / build

Change type of property 'TestProperty' from 'LSDW.Abstractions.Domain.Models.Base.IBindableProperty<string>' to 'LSDW.Domain.Models.Base.BindableProperty<string>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public void DealerSettingsInstanceTest()
[TestMethod]
public void GetDownTimeInHoursValuesTest()
{
int[] values = _settings.Dealer.GetDownTimeInHoursValues();
int[]? values = _settings.Dealer.GetDownTimeInHoursValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}
}
20 changes: 10 additions & 10 deletions tests/LSDW.Domain.Tests/Models/SettingsTests.MarketSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,45 @@ public void MarketSettingsInstanceTest()
[TestMethod]
public void GetSpecialOfferChanceValuesTest()
{
float[] values = _settings.Market.GetSpecialOfferChanceValues();
float[]? values = _settings.Market.GetSpecialOfferChanceValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetInventoryChangeIntervalValuesTest()
{
int[] values = _settings.Market.GetInventoryChangeIntervalValues();
int[]? values = _settings.Market.GetInventoryChangeIntervalValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetPriceChangeIntervalValuesTest()
{
int[] values = _settings.Market.GetPriceChangeIntervalValues();
int[]? values = _settings.Market.GetPriceChangeIntervalValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetMaximumDrugPriceValuesTest()
{
float[] values = _settings.Market.GetMaximumDrugPriceValues();
float[]? values = _settings.Market.GetMaximumDrugPriceValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetMinimumDrugPriceValuesTest()
{
float[] values = _settings.Market.GetMinimumDrugPriceValues();
float[]? values = _settings.Market.GetMinimumDrugPriceValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}
}
12 changes: 6 additions & 6 deletions tests/LSDW.Domain.Tests/Models/SettingsTests.PlayerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ public void PlayerSettingsInstanceTest()
[TestMethod]
public void GetExperienceMultiplierValuesTest()
{
float[] values = _settings.Player.GetExperienceMultiplierValues();
float[]? values = _settings.Player.GetExperienceMultiplierValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetInventoryExpansionPerLevelValuesTest()
{
int[] values = _settings.Player.GetInventoryExpansionPerLevelValues();
int[]? values = _settings.Player.GetInventoryExpansionPerLevelValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetStartingInventoryValuesTest()
{
int[] values = _settings.Player.GetStartingInventoryValues();
int[]? values = _settings.Player.GetStartingInventoryValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ public void TraffickingSettingsInstanceTest()
[TestMethod]
public void GetBustChanceValuesTest()
{
float[] values = _settings.Trafficking.GetBustChanceValues();
float[]? values = _settings.Trafficking.GetBustChanceValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}

[TestMethod]
public void GetWantedLevelValuesTest()
{
int[] values = _settings.Trafficking.GetWantedLevelValues();
int[]? values = _settings.Trafficking.GetWantedLevelValues();

Assert.IsNotNull(values);
Assert.IsTrue(values.Any());
Assert.AreNotEqual(0, values.Length);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void CreateDrugFromStateTest()
{
DrugState state = GetDrugState();

IDrug drug = CreateDrug(state);
IDrug? drug = CreateDrug(state);

Assert.IsNotNull(drug);
Assert.AreEqual(state.Type, drug.Type);
Expand All @@ -31,9 +31,9 @@ public void CreateDrugFromStateTest()
[TestMethod]
public void CreateDrugsFromStatesTest()
{
List<DrugState> states = new() { GetDrugState(), GetDrugState() };
List<DrugState> states = [GetDrugState(), GetDrugState()];

ICollection<IDrug> drugs = CreateDrugs(states);
ICollection<IDrug>? drugs = CreateDrugs(states);

Assert.IsNotNull(drugs);
Assert.AreEqual(states.Count, drugs.Count);
Expand All @@ -44,7 +44,7 @@ public void CreateDrugStateTest()
{
IDrug drug = DomainFactory.CreateDrug();

DrugState state = CreateDrugState(drug);
DrugState? state = CreateDrugState(drug);

Assert.IsNotNull(state);
Assert.AreEqual(drug.Type, state.Type);
Expand All @@ -57,7 +57,7 @@ public void CreateDrugStatesTest()
{
ICollection<IDrug> drugs = DomainFactory.CreateAllDrugs();

List<DrugState> states = CreateDrugStates(drugs);
List<DrugState>? states = CreateDrugStates(drugs);

Assert.IsNotNull(states);
Assert.AreEqual(drugs.Count, states.Count);
Expand All @@ -69,7 +69,7 @@ public void CreateInventoryStateTest()
int money = 1000;
IInventory inventory = DomainFactory.CreateInventory(money);

InventoryState state = CreateInventoryState(inventory);
InventoryState? state = CreateInventoryState(inventory);

Assert.IsNotNull(state);
Assert.IsNotNull(state.Drugs);
Expand Down Expand Up @@ -101,11 +101,13 @@ public void CreatePlayerStateTest()
[TestMethod]
public void CreateDealerStatesTest()
{
ICollection<IDealer> dealers = new List<IDealer>()
{
ICollection<IDealer>? dealers;

dealers =
[
DomainFactory.CreateDealer(_zeroVector, _pedHash),
DomainFactory.CreateDealer(_zeroVector, _pedHash),
};
];

List<DealerState> states = CreateDealerStates(dealers);

Expand Down Expand Up @@ -194,11 +196,13 @@ public void CreateTransactionStateTest()
[TestMethod]
public void CreateTransactionStatesTest()
{
ICollection<ITransaction> transactions = new List<ITransaction>()
{
ICollection<ITransaction>? transactions;

transactions =
[
DomainFactory.CreateTransaction(DateTime.MinValue, TransactionType.SELL, DrugType.COKE, 10, 100),
DomainFactory.CreateTransaction(DateTime.MinValue, TransactionType.SELL, DrugType.METH, 10, 125),
};
];

List<TransactionState> states = CreateTransactionStates(transactions);

Expand All @@ -211,11 +215,11 @@ public void CreateGameStateTest()
{
IPlayer player = DomainFactory.CreatePlayer(RandomHelper.GetInt(123456789, 987654321));
player.Inventory.Restock(player.Level);
List<IDealer> dealers = new()
{
List<IDealer> dealers =
[
DomainFactory.CreateDealer(_zeroVector),
DomainFactory.CreateDealer(_zeroVector),
};
];
foreach (IDealer dealer in dealers)
_ = dealer.Inventory.Restock(player.Level);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\src\LSDW.Infrastructure\LSDW.Infrastructure.csproj" />
Expand Down
Loading