Skip to content

Commit

Permalink
Update Unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmaster187 committed Jan 30, 2024
1 parent e0fd05e commit cb46ae5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
74 changes: 37 additions & 37 deletions UnitTestsTeslalogger/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UnitTest1
// [TestMethod]
public void TestJapanese()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);

Tools.SetThreadEnUS();
long unixTimestamp = (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
Expand All @@ -37,7 +37,7 @@ public void TestJapanese()
[TestMethod]
public void Car_S85D()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -53,7 +53,7 @@ public void Car_S85D()
[TestMethod]
public void Car_S85D_350V()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -70,7 +70,7 @@ public void Car_S85D_350V()
[TestMethod]
public void Car_S_P85()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -87,7 +87,7 @@ public void Car_S_P85()
[TestMethod]
public void Car_M3_LR_RWD()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -105,7 +105,7 @@ public void Car_M3_LR_RWD()
[TestMethod]
public void Car_M3_LR_RWD2()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -124,7 +124,7 @@ public void Car_M3_LR_RWD2()
[TestMethod]
public void Car_M3_LR_P_2019()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

//2021 Model 3 LR Performance
Expand All @@ -144,7 +144,7 @@ public void Car_M3_LR_P_2019()
[TestMethod]
public void Car_M3_LR_P_2021()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

//2021 Model 3 LR Performance
Expand All @@ -164,7 +164,7 @@ public void Car_M3_LR_P_2021()
[TestMethod]
public void Car_M3_LR_P_2021_MIC()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

//2021 Model 3 LR Performance
Expand All @@ -184,7 +184,7 @@ public void Car_M3_LR_P_2021_MIC()
[TestMethod]
public void Car_M3_LR()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -202,7 +202,7 @@ public void Car_M3_LR()
[TestMethod]
public void Car_M3_LR_DegradedBattery()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -220,7 +220,7 @@ public void Car_M3_LR_DegradedBattery()
[TestMethod]
public void Car_M3_LR_P()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -239,7 +239,7 @@ public void Car_M3_LR_P()
[TestMethod]
public void Car_M3_SRPlus_LFP()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -258,7 +258,7 @@ public void Car_M3_SRPlus_LFP()
[TestMethod]
public void Car_M3_SRPlus_LFP_2021()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -277,7 +277,7 @@ public void Car_M3_SRPlus_LFP_2021()
[TestMethod]
public void Car_M3_SRPlus_LFP_2021_60kWh()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -296,7 +296,7 @@ public void Car_M3_SRPlus_LFP_2021_60kWh()
[TestMethod]
public void Car_M3_SRPlus_LFP_2021_without_charging()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -315,7 +315,7 @@ public void Car_M3_SRPlus_LFP_2021_without_charging()
[TestMethod]
public void Car_M3_SRPlus_2021()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

//2021 Model 3 SR+
Expand All @@ -335,7 +335,7 @@ public void Car_M3_SRPlus_2021()
[TestMethod]
public void Car_S_75D()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;
MemoryCache.Default.Remove("GetAvgMaxRage_0");
wh.car.CarType = "models2";
Expand All @@ -351,7 +351,7 @@ public void Car_S_75D()
[TestMethod]
public void Car_S_75D_400V()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;
MemoryCache.Default.Remove("GetAvgMaxRage_0");
wh.car.CarType = "models2";
Expand All @@ -369,7 +369,7 @@ public void Car_S_75D_400V()
[TestMethod]
public void Car_S_90D()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -385,7 +385,7 @@ public void Car_S_90D()
[TestMethod]
public void Car_S_Raven_SR()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -403,7 +403,7 @@ public void Car_S_Raven_SR()
[TestMethod]
public void Car_S_Raven_LR()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -421,7 +421,7 @@ public void Car_S_Raven_LR()
[TestMethod]
public void Car_S_100D_Raven()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -440,7 +440,7 @@ public void Car_S_100D_Raven()
[TestMethod]
public void Car_S_Raven_LR_P()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -460,7 +460,7 @@ public void Car_S_Raven_LR_P()
[TestMethod]
public void Car_X_100D()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -476,7 +476,7 @@ public void Car_X_100D()
[TestMethod]
public void Car_X_100DRaven()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -494,7 +494,7 @@ public void Car_X_100DRaven()
[TestMethod]
public void Car_X_2021_Plaid()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -511,7 +511,7 @@ public void Car_X_2021_Plaid()
[TestMethod]
public void Car_S_2021_Plaid()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -528,7 +528,7 @@ public void Car_S_2021_Plaid()
[TestMethod]
public void Car_Y_LR_AWD_US()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -546,7 +546,7 @@ public void Car_Y_LR_AWD_US()
[TestMethod]
public void Car_Y_LR_AWD_MIC_2021()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -565,7 +565,7 @@ public void Car_Y_LR_AWD_MIC_2021()
[TestMethod]
public void Car_Y_LR_AWD_MIC_2022()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand All @@ -584,7 +584,7 @@ public void Car_Y_LR_AWD_MIC_2022()
[TestMethod]
public void Car_YP_MIG_First30()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

MemoryCache.Default.Remove("GetAvgMaxRage_0");
Expand Down Expand Up @@ -772,7 +772,7 @@ public void CreateAuthTokenWithoutRefreshToken()
[TestMethod]
public void SendDataToAbetterrouteplanner()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
WebHelper wh = c.webhelper;

long ts = Tools.ToUnixTime(DateTime.Now) / 1000;
Expand Down Expand Up @@ -855,7 +855,7 @@ public void OpenWBMeterNoParam()
[TestMethod]
public void OpenWBMeterConstructor()
{
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "ffffffff", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "ffffffff", null, false);
c.CarInDB = 1;

var v = ElectricityMeterBase.Instance(c);
Expand Down Expand Up @@ -1034,7 +1034,7 @@ public void GeocacheBasic()
public void TeslaApiVehicles()
{
var json = System.IO.File.ReadAllText("../../TeslaApiVehicles.txt");
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
var t = new TeslaAPIState(c);
t.ParseAPI(json, "vehicles");

Expand Down Expand Up @@ -1062,7 +1062,7 @@ public void TeslaApiVehicles()
public void TeslaApiVehiclesEmpty()
{
var json = "{\"response\":[],\"Count\":0}";
Car c = new Car(1, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(1, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
var t = new TeslaAPIState(c);
var ret = t.ParseAPI(json, "vehicles");

Expand All @@ -1073,7 +1073,7 @@ public void TeslaApiVehiclesEmpty()
public void TeslaApiUpdateAvailable()
{
var json = System.IO.File.ReadAllText("../../vehicle_state_with_update_available.txt");
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
Car c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);
var t = new TeslaAPIState(c);
t.ParseAPI(json, "vehicle_state");

Expand Down
2 changes: 1 addition & 1 deletion UnitTestsTeslalogger/UnitTestGeocodeMapQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TestInitialize()
var geofence = Geofence.GetInstance();

if (c == null)
c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);

geofence = Geofence.GetInstance();
geofence.geofenceList.Clear();
Expand Down
2 changes: 1 addition & 1 deletion UnitTestsTeslalogger/UnitTestsGeocode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void TestInitialize()
var geofence = Geofence.GetInstance();

if (c == null)
c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null);
c = new Car(0, "", "", 0, "", DateTime.Now, "", "", "", "", "", "", "", null, false);

geofence = Geofence.GetInstance();
geofence.geofenceList.Clear();
Expand Down

0 comments on commit cb46ae5

Please sign in to comment.