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

New Car: M3 LR RWD 2023 #1186

Merged
merged 1 commit into from
Feb 15, 2024
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
16 changes: 11 additions & 5 deletions TeslaLogger/WebHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2635,11 +2635,17 @@ public void UpdateEfficiency()
{
if (!AWD)
{
if (MIC)
WriteCarSettings("0.138", "M3 SR+ LFP 2021");
else
WriteCarSettings("0.145", "M3 LR RWD");
return;
if (!AWD)
{
if (MIC)
if (battery == "LFP")
WriteCarSettings("0.138", "M3 SR+ LFP 2021");
else
WriteCarSettings("0.142", "M3 LR RWD 2023");
else
WriteCarSettings("0.145", "M3 LR RWD 2019");
return;
}
}
else if (motor == "3 dual performance" && year == 2021)
{
Expand Down
23 changes: 21 additions & 2 deletions UnitTestsTeslalogger/UnitTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void Car_M3_LR_RWD()
wh.car.Vin = "5YJ3E7EA9KFxxxxxx";
wh.UpdateEfficiency();

Assert.AreEqual("M3 LR RWD", wh.car.ModelName);
Assert.AreEqual("M3 LR RWD 2019", wh.car.ModelName);
Assert.AreEqual(0.145, wh.car.WhTR);
}

Expand All @@ -118,10 +118,29 @@ public void Car_M3_LR_RWD2()
wh.car.TrimBadging = "";
wh.UpdateEfficiency();

Assert.AreEqual("M3 LR RWD", wh.car.ModelName);
Assert.AreEqual("M3 LR RWD 2019", wh.car.ModelName);
Assert.AreEqual(0.145, wh.car.WhTR);
}

[TestMethod]
public void Car_M3_LR_RWD_2023()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
MemoryCache.Default.Add("GetAvgMaxRage_0", 535, DateTime.Now.AddMinutes(1));
wh.car.Vin = "LRW3E7ES7PCXXXXXX";
wh.car.CarType = "model3";
wh.car.CarSpecialType = "base";
wh.car.DBWhTR = 0.142;
wh.car.TrimBadging = "";
wh.UpdateEfficiency();

Assert.AreEqual("M3 LR RWD 2023", wh.car.ModelName);
Assert.AreEqual(0.142, wh.car.WhTR);
}

[TestMethod]
public void Car_M3_LR_P_2019()
{
Expand Down
Loading