protected override void setRandomValues(RequestTransaction o) { o.Data.Amount = GetRandom.Decimal(); o.Data.Explanation = GetRandom.String(); o.Data.Status = GetRandom.Enum <TransactionStatus>(); base.setRandomValues(o); }
public static Rounding Random() { var s = GetRandom.Enum <Approximate>(); var decimals = GetRandom.Int8(-10, 10); var rd = GetRandom.UInt8(0, 9); var rs = 0.05 * GetRandom.UInt8(0, 10); return(new Rounding(s, decimals, rd, rs)); }
public void TestEnumProperty <T>(Func <T> get, Action <T> set) { Assert.IsTrue(typeof(T).IsEnum); var i = GetEnum.Value <T>(0); Assert.AreEqual(i, get()); var s = GetRandom.Enum <T>(); set(s); Assert.AreEqual(s, get()); }
[TestMethod] public void OperationTest() { Operation op; do { op = GetRandom.Enum <Operation>(); } while (op == Operation.Dummy); obj.Operation = op; Assert.AreEqual(obj.Name, op.ToString()); Assert.AreEqual(obj.Operation, op); }
public void EnumTest() { var e = GetRandom.Enum <EventType>(); Assert.IsInstanceOfType(e, typeof(EventType)); while (true) { if (GetRandom.Enum <EventType>() != e) { return; } } }
[TestMethod] public void EnumTest() { var e = GetRandom.Enum <IsoGender>(); Assert.IsInstanceOfType(e, typeof(IsoGender)); while (true) { if (GetRandom.Enum <IsoGender>() != e) { return; } } }
private void initializeTestData() { var min = DateTime.Now.AddYears(-50); var max = DateTime.Now.AddYears(50); id = GetRandom.String(); amount = GetRandom.Decimal(); explanation = GetRandom.String(); senderAccountId = GetRandom.String(); receiverAccountId = GetRandom.String(); status = GetRandom.Enum <TransactionStatus>(); validFrom = GetRandom.DateTime(min, max); validTo = GetRandom.DateTime(validFrom, max); }
protected void testEnumProperty <T>(Func <T> get, Action <T> set) { Assert.IsTrue(typeof(T).IsEnum); var x = get(); var s = GetRandom.Enum <T>(); while (x.Equals(s)) { s = GetRandom.Enum <T>(); } Assert.AreNotEqual(s, get()); set(s); Assert.AreEqual(s, get()); }
protected override void SetRandomValues() { base.SetRandomValues(); operation = GetRandom.Enum <Operation>(); }