Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
myangelkamikaze committed Nov 18, 2023
1 parent f166369 commit c5ad796
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions ElectronicObserverCoreTests/LoSTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public void LoSTest2TestData()
Assert.Equal(expected4, actual4.RoundDown(2));
}

/// <summary>
/// {"version":4,"hqlv":120,"f1":{"s1":{"id":586,"lv":151,"items":{"i1":{"id":102},"i2":{"id":102}},"hp":55,"luck":10},"s2":{"id":623,"lv":159,"items":{},"hp":47,"luck":30},"s3":{"id":568,"lv":162,"items":{},"hp":38,"luck":22},"s4":{"id":566,"lv":162,"items":{},"hp":38,"luck":20},"s5":{"id":567,"lv":161,"items":{},"hp":38,"luck":24},"s6":{"id":543,"lv":164,"items":{},"hp":38,"luck":30}},"a1":{"items":{},"mode":1},"a2":{"items":{},"mode":1},"a3":{"items":{},"mode":1}}
/// </summary>
[Fact]
public void LoSTest3TestData()
{
Expand Down Expand Up @@ -129,10 +132,10 @@ public void LoSTest3TestData()
}),
};

double expected1 = 10.48;
double expected2 = 17.68;
double expected3 = 24.88;
double expected4 = 32.08;
double expected1 = 10.54;
double expected2 = 17.74;
double expected3 = 24.94;
double expected4 = 32.14;

double actual1 = Calculator.GetSearchingAbility_New33(fleet, 1, AdmiralLevel);
double actual2 = Calculator.GetSearchingAbility_New33(fleet, 2, AdmiralLevel);
Expand All @@ -145,6 +148,9 @@ public void LoSTest3TestData()
Assert.Equal(expected4, actual4.RoundDown(2));
}

/// <summary>
/// {"version":4,"hqlv":120,"f1":{"s1":{"id":586,"lv":151,"items":{"i1":{"id":102},"i2":{"id":102},"i3":{"id":129}},"hp":55,"luck":10},"s2":{"id":623,"lv":159,"items":{"i1":{"id":129}},"hp":47,"luck":30},"s3":{"id":568,"lv":162,"items":{"i1":{"id":129}},"hp":38,"luck":22},"s4":{"id":566,"lv":162,"items":{"i1":{"id":129}},"hp":38,"luck":20},"s5":{"id":567,"lv":161,"items":{"i1":{"id":129}},"hp":38,"luck":24},"s6":{"id":543,"lv":164,"items":{"i1":{"id":129}},"hp":38,"luck":30}},"a1":{"items":{},"mode":1},"a2":{"items":{},"mode":1},"a3":{"items":{},"mode":1}}
/// </summary>
[Fact]
public void LoSTest4TestData()
{
Expand All @@ -162,6 +168,7 @@ public void LoSTest4TestData()
ShipDataMock yuubari = new(Db.MasterShips[ShipId.YuubariKaiNiToku])
{
Level = 159,
LosFit = 3,
SlotInstance = new List<IEquipmentData?>
{
new EquipmentDataMock(Db.MasterEquipment[EquipmentId.SurfaceShipPersonnel_SkilledLookouts]),
Expand All @@ -171,6 +178,7 @@ public void LoSTest4TestData()
ShipDataMock kuroshio = new(Db.MasterShips[ShipId.KuroshioKaiNi])
{
Level = 162,
LosFit = 1,
SlotInstance = new List<IEquipmentData?>
{
new EquipmentDataMock(Db.MasterEquipment[EquipmentId.SurfaceShipPersonnel_SkilledLookouts]),
Expand All @@ -180,6 +188,7 @@ public void LoSTest4TestData()
ShipDataMock kagerou = new(Db.MasterShips[ShipId.KagerouKaiNi])
{
Level = 162,
LosFit = 1,
SlotInstance = new List<IEquipmentData?>
{
new EquipmentDataMock(Db.MasterEquipment[EquipmentId.SurfaceShipPersonnel_SkilledLookouts]),
Expand All @@ -189,6 +198,7 @@ public void LoSTest4TestData()
ShipDataMock shiranui = new(Db.MasterShips[ShipId.ShiranuiKaiNi])
{
Level = 161,
LosFit = 1,
SlotInstance = new List<IEquipmentData?>
{
new EquipmentDataMock(Db.MasterEquipment[EquipmentId.SurfaceShipPersonnel_SkilledLookouts]),
Expand All @@ -198,6 +208,7 @@ public void LoSTest4TestData()
ShipDataMock naganami = new(Db.MasterShips[ShipId.NaganamiKaiNi])
{
Level = 164,
LosFit = 1,
SlotInstance = new List<IEquipmentData?>
{
new EquipmentDataMock(Db.MasterEquipment[EquipmentId.SurfaceShipPersonnel_SkilledLookouts]),
Expand All @@ -217,10 +228,10 @@ public void LoSTest4TestData()
}),
};

double expected1 = 17.68;
double expected2 = 32.08;
double expected3 = 46.48;
double expected4 = 60.88;
double expected1 = 18.16;
double expected2 = 32.56;
double expected3 = 46.96;
double expected4 = 61.36;

double actual1 = Calculator.GetSearchingAbility_New33(fleet, 1, AdmiralLevel);
double actual2 = Calculator.GetSearchingAbility_New33(fleet, 2, AdmiralLevel);
Expand Down

0 comments on commit c5ad796

Please sign in to comment.