Merge branch 'develop' of https://github.com/sp-tarkov/server-csharp into develop

# Conflicts:
#	UnitTests/Tests/Helpers/BotGeneratorHelperTests.cs
This commit is contained in:
Alex
2025-07-22 20:36:55 +01:00
4 changed files with 7 additions and 12 deletions
@@ -33,9 +33,8 @@
<!-- BuildType options - LOCAL, DEBUG, RELEASE, BLEEDING_EDGE, BLEEDING_EDGE_MODS - *must be all caps*-->
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="UnitTests"/>
<InternalsVisibleTo Include="UnitTests" />
</ItemGroup>
<Target Name="AfterEverythingDone" AfterTargets="PostBuildEvent">
<Exec
ConsoleToMsBuild="true"
+3 -1
View File
@@ -15,6 +15,7 @@ public class DI
private static IServiceProvider _serviceProvider;
private static DI? _instance;
private DI()
{
ConfigureServices();
@@ -59,7 +60,8 @@ public class DI
}
}
public T GetService<T>() where T : notnull
public T GetService<T>()
where T : notnull
{
return _serviceProvider.GetRequiredService<T>();
}
@@ -139,8 +139,8 @@ public class BotGeneratorHelperTests
Assert.AreEqual(ItemAddedResult.SUCCESS, result);
var weaponRoot = weaponWithChildren.FirstOrDefault(item => item.Id == rootWeaponId);
Assert.AreEqual((weaponRoot.Location as ItemLocation).X, 0);
Assert.AreEqual((weaponRoot.Location as ItemLocation).Y, 0);
Assert.AreNotEqual((weaponRoot.Location as ItemLocation).X, 0);
Assert.AreNotEqual((weaponRoot.Location as ItemLocation).Y, 0);
Assert.AreEqual((weaponRoot.Location as ItemLocation).R, ItemRotation.Horizontal);
foreach (var item in botInventory.Items.Where(i => tplsToAdd.ContainsKey(i.Template)))
{
@@ -173,13 +173,7 @@ public class InventoryHelperTests
Template = "6699249f3c4fda6471005cba",
ParentId = root.Id,
SlotId = "mod_stock",
Upd = new Upd
{
Foldable = new UpdFoldable
{
Folded = true
}
},
Upd = new Upd { Foldable = new UpdFoldable { Folded = true } },
};
weaponWithChildren.Add(stock);