mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 03:27:29 +02:00
Version 3.0.337
This commit is contained in:
parent
fd0e63cf10
commit
573fe77e12
2336 changed files with 33688 additions and 86082 deletions
|
@ -1,11 +1,11 @@
|
|||
using NUnit.Framework;
|
||||
using System;
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using TINK.Model.State;
|
||||
|
||||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
|
||||
|
||||
[TestFixture]
|
||||
public class TestStateBookedInfo
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ using TINK.Model.State;
|
|||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
|
||||
|
||||
[TestFixture]
|
||||
public class TestStateDisposableInfo
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using TINK.Model.State;
|
||||
|
||||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
|
||||
|
||||
[TestFixture]
|
||||
public class TestStateInfo
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace TestTINKLib
|
|||
var l_oSource = MockRepository.GenerateStub<IStateInfo>();
|
||||
l_oSource.Stub(x => x.Value).Return(InUseStateEnum.Disposable);
|
||||
|
||||
var l_oState = new StateInfoMutable(p_oState: l_oSource);
|
||||
var l_oState = new StateInfoMutable(state: l_oSource);
|
||||
|
||||
Assert.AreEqual(InUseStateEnum.Disposable, l_oState.Value);
|
||||
Assert.IsNull(l_oState.RemainingTime);
|
||||
|
@ -84,9 +84,9 @@ namespace TestTINKLib
|
|||
// Update state from Copri.
|
||||
l_oStateInfo.Load(
|
||||
InUseStateEnum.Reserved, // Copri acknowledges state reserved.
|
||||
l_oDateTimeMock.GetDateTime(),
|
||||
l_oDateTimeMock.GetDateTime(),
|
||||
"heiz@mustermann"); // Owner from Copri.
|
||||
|
||||
|
||||
// Invoke first update (after simulated 4mns)
|
||||
l_oStateInfo.UpdateOnTimeElapsed();
|
||||
Assert.AreEqual(InUseStateEnum.Reserved, l_oStateInfo.Value);
|
||||
|
@ -123,7 +123,7 @@ namespace TestTINKLib
|
|||
l_oStateInfo.Load(InUseStateEnum.Reserved, FROM, "heiz@mustermann", "22");
|
||||
|
||||
// Verify initial values of properties.
|
||||
Assert.AreEqual(InUseStateEnum.Reserved, l_oStateInfo.Value);
|
||||
Assert.AreEqual(InUseStateEnum.Reserved, l_oStateInfo.Value);
|
||||
Assert.AreEqual("Reserved", l_oStateInfo.ToString());
|
||||
Assert.AreEqual(new TimeSpan(0, 15, 0).Subtract(l_oNowMock().Subtract(FROM)).Minutes, l_oStateInfo.RemainingTime.Value.Minutes);
|
||||
Assert.AreEqual(FROM, l_oStateInfo.From);
|
||||
|
@ -137,7 +137,7 @@ namespace TestTINKLib
|
|||
Assert.AreEqual("Disposable", l_oStateInfo.ToString());
|
||||
Assert.IsNull(l_oStateInfo.RemainingTime);
|
||||
Assert.IsNull(l_oStateInfo.From);
|
||||
Assert.IsNull( l_oStateInfo.MailAddress);
|
||||
Assert.IsNull(l_oStateInfo.MailAddress);
|
||||
Assert.IsNull(l_oStateInfo.Code);
|
||||
}
|
||||
|
||||
|
@ -154,9 +154,9 @@ namespace TestTINKLib
|
|||
|
||||
// Construct requested state object.
|
||||
var l_oSource = new StateInfo(
|
||||
() => new DateTime(2018, 01, 03, 21, 53, 0),
|
||||
() => new DateTime(2018, 01, 03, 21, 53, 0),
|
||||
new DateTime(2018, 01, 03, 21, 13, 0), // Requested from
|
||||
"a@b",
|
||||
"a@b",
|
||||
"123");
|
||||
l_oState.Load(l_oSource);
|
||||
Assert.AreEqual(InUseStateEnum.Reserved, l_oState.Value);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using TINK.Model.State;
|
||||
|
||||
|
||||
namespace TestTINKLib.Fixtures.State
|
||||
{
|
||||
|
||||
|
||||
[TestFixture]
|
||||
public class TestStateInfoSerializeJSON
|
||||
{
|
||||
|
@ -33,8 +33,8 @@ namespace TestTINKLib.Fixtures.State
|
|||
}
|
||||
}";
|
||||
Assert.AreEqual(
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED.Replace("\n", string.Empty).Replace("\r", string.Empty)),
|
||||
TestHelper.PrepareXmlForStringCompare(l_strJSONDetected.Replace("\n", string.Empty).Replace("\r", string.Empty)));
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED.Replace("\n", string.Empty).Replace("\r", string.Empty)),
|
||||
TestHelper.PrepareXmlForStringCompare(l_strJSONDetected.Replace("\n", string.Empty).Replace("\r", string.Empty)));
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -87,8 +87,8 @@ namespace TestTINKLib.Fixtures.State
|
|||
});
|
||||
|
||||
Assert.AreEqual(
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED).Replace("\n", string.Empty).Replace("\r", string.Empty),
|
||||
TestHelper.PrepareXmlForStringCompare(l_oDetected).Replace("\n", string.Empty).Replace("\r", string.Empty));
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED).Replace("\n", string.Empty).Replace("\r", string.Empty),
|
||||
TestHelper.PrepareXmlForStringCompare(l_oDetected).Replace("\n", string.Empty).Replace("\r", string.Empty));
|
||||
|
||||
// Deserialize object an verify state.
|
||||
var l_oStateTarget = JsonConvert.DeserializeObject<StateInfoMutable>(l_oDetected, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto });
|
||||
|
@ -136,8 +136,8 @@ namespace TestTINKLib.Fixtures.State
|
|||
}";
|
||||
|
||||
Assert.AreEqual(
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED.Replace("\n", string.Empty).Replace("\r", string.Empty)),
|
||||
TestHelper.PrepareXmlForStringCompare(l_strJSONDetected.Replace("\n", string.Empty).Replace("\r", string.Empty)));
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED.Replace("\n", string.Empty).Replace("\r", string.Empty)),
|
||||
TestHelper.PrepareXmlForStringCompare(l_strJSONDetected.Replace("\n", string.Empty).Replace("\r", string.Empty)));
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -194,8 +194,8 @@ namespace TestTINKLib.Fixtures.State
|
|||
}";
|
||||
|
||||
Assert.AreEqual(
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED.Replace("\n", string.Empty).Replace("\r", string.Empty)),
|
||||
TestHelper.PrepareXmlForStringCompare(l_strJSONDetected.Replace("\n", string.Empty).Replace("\r", string.Empty)));
|
||||
TestHelper.PrepareXmlForStringCompare(EXPECTED.Replace("\n", string.Empty).Replace("\r", string.Empty)),
|
||||
TestHelper.PrepareXmlForStringCompare(l_strJSONDetected.Replace("\n", string.Empty).Replace("\r", string.Empty)));
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
using NUnit.Framework;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using TINK.Model.State;
|
||||
|
||||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
|
||||
|
||||
[TestFixture]
|
||||
public class TestStateRequestedInfo
|
||||
{
|
||||
|
@ -40,19 +40,19 @@ namespace TestTINKLib
|
|||
public void TestConstruct_FromWebserver()
|
||||
{
|
||||
Assert.AreEqual(
|
||||
InUseStateEnum.Reserved,
|
||||
new StateRequestedInfo(() => new DateTime(2017,09, 20), new DateTime(2017, 09, 19), "a@b", "372").Value);
|
||||
InUseStateEnum.Reserved,
|
||||
new StateRequestedInfo(() => new DateTime(2017, 09, 20), new DateTime(2017, 09, 19), "a@b", "372").Value);
|
||||
|
||||
Assert.AreEqual(
|
||||
"a@b",
|
||||
new StateRequestedInfo(() => new DateTime(2017, 09, 20), new DateTime(2017, 09, 19), "a@b", "372").MailAddress);
|
||||
|
||||
|
||||
Assert.AreEqual(
|
||||
"372",
|
||||
"372",
|
||||
new StateRequestedInfo(() => new DateTime(2017, 09, 20), new DateTime(2017, 09, 19), "a@b", "372").Code);
|
||||
|
||||
Assert.AreEqual(
|
||||
new DateTime(2017,09, 19),
|
||||
new DateTime(2017, 09, 19),
|
||||
new StateRequestedInfo(() => new DateTime(2017, 09, 20), new DateTime(2017, 09, 19), "a@b", "372").From);
|
||||
|
||||
Assert.IsTrue(
|
||||
|
@ -67,7 +67,7 @@ namespace TestTINKLib
|
|||
public void TestTryUpdateOnTimeElapsed()
|
||||
{
|
||||
var l_oReservedAt = new DateTime(2017, 09, 20, 22, 01, 00);
|
||||
var l_oDateTimeMock = new DateTimeMocker( new List<DateTime> {
|
||||
var l_oDateTimeMock = new DateTimeMocker(new List<DateTime> {
|
||||
l_oReservedAt.Add(new TimeSpan(0, 4, 0)), // Reserved for 4 mns
|
||||
l_oReservedAt.Add(new TimeSpan(0, 16, 0)) // Time elapsed since booking 16 mns
|
||||
});
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using TINK.Model.State;
|
||||
|
||||
|
||||
namespace TestTINKLib.Fixtures.State
|
||||
{
|
||||
|
||||
|
||||
[TestFixture]
|
||||
public class TestStateReInquestedfoSerializeJSON
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue