public void AcquireDataTest() { RAM_Accessor target = new RAM_Accessor(); List <string> indicatorNames = new List <string>(); indicatorNames.Add(target.indicators[0].IndicatorName); indicatorNames.Add(target.indicators[2].IndicatorName); indicatorNames.Add(target.indicators[3].IndicatorName); List <Tuple <string, object, DataType> > actual; actual = target.AcquireData(indicatorNames); Assert.IsTrue(actual.Count == 3); foreach (Tuple <string, object, DataType> tup in actual) { Assert.IsNotNull(tup.Item1); switch (tup.Item3) { case DataType.Byte: Assert.IsNotNull(Convert.ToByte(tup.Item2)); break; case DataType.Float: Assert.IsNotNull(Convert.ToDouble(tup.Item2)); break; case DataType.Int: Assert.IsNotNull(Convert.ToInt32(tup.Item2)); break; case DataType.String: Assert.IsNotNull(Convert.ToString(tup.Item2)); break; default: Assert.Fail(); break; } } }
public void GetSwapSizeTest() { RAM_Accessor target = new RAM_Accessor(); Tuple <string, object, DataType> actual; actual = target.GetSwapSize(); Assert.IsTrue(Convert.ToInt32(actual.Item2) >= 0); }
public void GetSwapLoadTest() { RAM_Accessor target = new RAM_Accessor(); Tuple <string, object, DataType> actual; actual = target.GetSwapLoad(); Assert.IsTrue(Convert.ToByte(actual.Item2) >= 0 && Convert.ToByte(actual.Item2) <= 100); }