2 using System.Collections.Generic;
6 using Seci.Definitions;
18 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0", null, 0.0));
19 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0", null, 1.0));
20 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"true", null, 1.0));
27 Assert.IsFalse(BlockInfo.ExceedsTolerance(
"true",
"true", 0.0));
28 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"true",
"false", 0.0));
29 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"false",
"true", 0.0));
32 Assert.IsFalse(BlockInfo.ExceedsTolerance(
"true",
"true", 1.0));
33 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"true",
"false", 1.0));
34 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"false",
"true", 1.0));
41 Assert.IsFalse(BlockInfo.ExceedsTolerance(
"0.0",
"0.0", 0.0));
42 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0",
"0.1", 0.0));
43 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0",
"-0.1", 0.0));
50 Assert.IsFalse(BlockInfo.ExceedsTolerance(
"0.0",
"0.0", 1.0));
51 Assert.IsFalse(BlockInfo.ExceedsTolerance(
"0.0",
"0.9", 1.0));
52 Assert.IsFalse(BlockInfo.ExceedsTolerance(
"0.0",
"-0.9", 1.0));
53 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0",
"1.0", 1.0));
54 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0",
"-1.0", 1.0));
55 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0",
"100.0", 1.0));
56 Assert.IsTrue(BlockInfo.ExceedsTolerance(
"0.0",
"-100.0", 1.0));
64 DateTime timeLastLogged =
new DateTime(2000, 1, 1, 6, 0, 0);
66 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
67 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
68 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(30), timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
75 DateTime timeLastLogged =
new DateTime(2012, 3, 25, 1, 59, 55, DateTimeKind.Local);
76 DateTime newTime =
new DateTime(2012, 3, 25, 2, 0, 10, DateTimeKind.Local);
77 Assert.IsTrue(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
80 newTime =
new DateTime(2012, 3, 25, 2, 0, 5, DateTimeKind.Local);
81 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
88 DateTime timeLastLogged =
new DateTime(2012, 10, 28, 0, 59, 55, DateTimeKind.Local);
89 DateTime newTime =
new DateTime(2012, 10, 28, 1, 0, 10, DateTimeKind.Local);
90 Assert.IsTrue(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
93 newTime =
new DateTime(2012, 10, 28, 1, 0, 5, DateTimeKind.Local);
94 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0", 0.0,
false,
false));
101 DateTime timeLastLogged =
new DateTime(2000, 1, 1, 6, 0, 0);
103 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"0", 1.0,
false,
true));
104 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"0.9", 1.0,
false,
true));
105 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"1.0", 1.0,
false,
true));
106 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"-1.0", 1.0,
false,
true));
107 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"100.0", 1.0,
false,
true));
108 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0",
"-100.0", 1.0,
false,
true));
111 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"0", 1.0,
false,
true));
112 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"0.9", 1.0,
false,
true));
113 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"1.0", 1.0,
false,
true));
114 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"-1.0", 1.0,
false,
true));
115 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"100.0", 1.0,
false,
true));
116 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0",
"-100.0", 1.0,
false,
true));
123 DateTime timeLastLogged =
new DateTime(2012, 3, 25, 1, 59, 55, DateTimeKind.Local);
124 DateTime newTime =
new DateTime(2012, 3, 25, 2, 0, 10, DateTimeKind.Local);
125 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0.9", 1.0,
false,
true));
126 Assert.IsTrue(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"1.0", 1.0,
false,
true));
129 newTime =
new DateTime(2012, 3, 25, 2, 0, 5, DateTimeKind.Local);
130 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0.9", 1.0,
false,
true));
131 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"1.0", 1.0,
false,
true));
138 DateTime timeLastLogged =
new DateTime(2012, 10, 28, 0, 59, 55, DateTimeKind.Local);
139 DateTime newTime =
new DateTime(2012, 10, 28, 1, 0, 10, DateTimeKind.Local);
140 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0.9", 1.0,
false,
true));
141 Assert.IsTrue(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"1.0", 1.0,
false,
true));
144 newTime =
new DateTime(2012, 10, 28, 1, 0, 5, DateTimeKind.Local);
145 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"0.9", 1.0,
false,
true));
146 Assert.IsFalse(BlockInfo.OkayToLog(newTime, timeLastLogged, 15.0,
"0",
"1.0", 1.0,
false,
true));
153 DateTime timeLastLogged =
new DateTime(2000, 1, 1, 6, 0, 0);
155 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"0", 0.0,
true,
false));
156 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"0.1", 0.0,
true,
false));
157 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"-0.1", 0.0,
true,
false));
158 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"100.0", 0.0,
true,
false));
159 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"-100.0", 0.0,
true,
false));
166 DateTime timeLastLogged =
new DateTime(2000, 1, 1, 6, 0, 0);
168 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"0", 1.0,
true,
false));
169 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"0.9", 1.0,
true,
false));
170 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"1.0", 1.0,
true,
false));
171 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"-1.0", 1.0,
true,
false));
172 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"100.0", 1.0,
true,
false));
173 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"0",
"-100.0", 1.0,
true,
false));
180 DateTime timeLastLogged =
new DateTime(2000, 1, 1, 6, 0, 0);
183 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"1.0", null, 0.0,
true,
false));
186 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged, timeLastLogged, 15.0,
"1.0", null, 1.0,
true,
false));
189 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0", null, 0.0,
false,
false));
190 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0", null, 0.0,
false,
false));
193 Assert.IsFalse(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(14), timeLastLogged, 15.0,
"0", null, 1.0,
false,
false));
194 Assert.IsTrue(BlockInfo.OkayToLog(timeLastLogged.AddSeconds(15), timeLastLogged, 15.0,
"0", null, 1.0,
false,
false));
void OkayToLog_OnTimeInterval_ClocksForward()
void OkayToLog_OnTimeInterval_ClocksBack()
void OkayToLog_OnTimeInterval_WithTolerance_ClocksBack()
void OkayToLog_OnTimeInterval_WithTolerance_ClocksForward()
void OkayToLog_NoPreviousValue()
void ExceedsTolerance_Tolerance()
void ExceedsTolerance_Booleans()
void ExceedsTolerance_NoPreviousValue()
void OkayToLog_OnTimeInterval_WithTolerance()
void OkayToLog_OnTimeInterval()
void OkayToLog_OnAnyChange()
void OkayToLog_OnAnyChange_WithTolerance()
void ExceedsTolerance_NoTolerance()