public void SaveDataThrowsContractException64() { try { List<InvestmentData> list; User user; InvestmentData[] investmentDatas = new InvestmentData[0]; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); byte[] bs = new byte[0]; byte[] bs1 = new byte[0]; user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", bs); PexInvariant.SetField<byte[]>((object)user, "keyFile", bs1); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", "\u0100"); PexInvariant.CheckInvariant((object)user); this.SaveData(user, list); throw new AssertFailedException("expected an exception of type ContractException"); } catch(Exception ex) { if (!PexContract.IsContractException(ex)) throw ex; } }
public void InvestmentDataGet479() { SInvestmentData sInvestmentData; List<InvestmentData> list; User user; List<InvestmentData> list1; sInvestmentData = PexInvariant.CreateInstance<SInvestmentData>(); PexInvariant.SetField<uint>((object)sInvestmentData, "investmentPercentage", 0u); PexInvariant.SetField<string> ((object)sInvestmentData, "stockGroup", (string)null); PexInvariant.SetField<bool>((object)sInvestmentData, "__callBase", false); PexInvariant.SetField<IBehavior> ((object)sInvestmentData, "__instanceBehavior", (IBehavior)null); PexInvariant.CheckInvariant((object)sInvestmentData); InvestmentData[] investmentDatas = new InvestmentData[1]; investmentDatas[0] = (InvestmentData)sInvestmentData; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<int>((object)user, "blockSize", 0); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", (byte[])null); PexInvariant.SetField<byte[]>((object)user, "keyFile", (byte[])null); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", (string)null); PexInvariant.CheckInvariant((object)user); list1 = this.InvestmentDataGet(user); Assert.IsNotNull((object)list1); Assert.AreEqual<int>(1, list1.Capacity); Assert.AreEqual<int>(1, list1.Count); Assert.IsNotNull((object)user); Assert.AreEqual<int>(0, user.BlockSize); Assert.AreEqual<int>(1, user.ExpirationTime.Day); Assert.AreEqual<DayOfWeek>(DayOfWeek.Monday, user.ExpirationTime.DayOfWeek); Assert.AreEqual<int>(1, user.ExpirationTime.DayOfYear); Assert.AreEqual<int>(0, user.ExpirationTime.Hour); Assert.AreEqual<DateTimeKind> (DateTimeKind.Unspecified, user.ExpirationTime.Kind); Assert.AreEqual<int>(0, user.ExpirationTime.Millisecond); Assert.AreEqual<int>(0, user.ExpirationTime.Minute); Assert.AreEqual<int>(1, user.ExpirationTime.Month); Assert.AreEqual<int>(0, user.ExpirationTime.Second); Assert.AreEqual<int>(1, user.ExpirationTime.Year); Assert.AreEqual<decimal>(default(decimal), user.Funds); Assert.IsNull(user.IV); Assert.AreEqual<int>(0, user.Id); Assert.IsNotNull(user.InvestmentData); Assert.IsTrue(object.ReferenceEquals(user.InvestmentData, (object)list1)); Assert.IsNull(user.KeyFile); Assert.AreEqual<string>((string)null, user.Name); }
public void ExpirationTimeGet796() { List<InvestmentData> list; User user; DateTime dt; InvestmentData[] investmentDatas = new InvestmentData[0]; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); byte[] bs = new byte[0]; byte[] bs1 = new byte[0]; user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", bs); PexInvariant.SetField<byte[]>((object)user, "keyFile", bs1); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", "\u0100"); PexInvariant.CheckInvariant((object)user); dt = this.ExpirationTimeGet(user); Assert.AreEqual<int>(1, dt.Day); Assert.AreEqual<DayOfWeek>(DayOfWeek.Monday, dt.DayOfWeek); Assert.AreEqual<int>(1, dt.DayOfYear); Assert.AreEqual<int>(0, dt.Hour); Assert.AreEqual<DateTimeKind>(DateTimeKind.Unspecified, dt.Kind); Assert.AreEqual<int>(0, dt.Millisecond); Assert.AreEqual<int>(0, dt.Minute); Assert.AreEqual<int>(1, dt.Month); Assert.AreEqual<int>(0, dt.Second); Assert.AreEqual<int>(1, dt.Year); Assert.IsNotNull((object)user); Assert.AreEqual<int>(1, user.ExpirationTime.Day); Assert.AreEqual<DayOfWeek>(DayOfWeek.Monday, user.ExpirationTime.DayOfWeek); Assert.AreEqual<int>(1, user.ExpirationTime.DayOfYear); Assert.AreEqual<int>(0, user.ExpirationTime.Hour); Assert.AreEqual<DateTimeKind> (DateTimeKind.Unspecified, user.ExpirationTime.Kind); Assert.AreEqual<int>(0, user.ExpirationTime.Millisecond); Assert.AreEqual<int>(0, user.ExpirationTime.Minute); Assert.AreEqual<int>(1, user.ExpirationTime.Month); Assert.AreEqual<int>(0, user.ExpirationTime.Second); Assert.AreEqual<int>(1, user.ExpirationTime.Year); Assert.AreEqual<decimal>(default(decimal), user.Funds); Assert.IsNotNull(user.IV); Assert.AreEqual<int>(0, user.IV.Length); Assert.AreEqual<int>(0, user.Id); Assert.IsNotNull(user.InvestmentData); Assert.AreEqual<int>(0, user.InvestmentData.Capacity); Assert.AreEqual<int>(0, user.InvestmentData.Count); Assert.IsNotNull(user.KeyFile); Assert.AreEqual<int>(0, user.KeyFile.Length); Assert.AreEqual<string>("\u0100", user.Name); }
public void SaveDataThrowsContractException192() { try { InvestmentData investmentData; List<InvestmentData> list; User user; SInvestmentData sInvestmentData; List<InvestmentData> list1; investmentData = PexInvariant.CreateInstance<InvestmentData>(); PexInvariant.SetField<uint> ((object)investmentData, "investmentPercentage", 0u); PexInvariant.SetField<string> ((object)investmentData, "stockGroup", (string)null); PexInvariant.CheckInvariant((object)investmentData); InvestmentData[] investmentDatas = new InvestmentData[1]; investmentDatas[0] = investmentData; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<int>((object)user, "blockSize", 0); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", (byte[])null); PexInvariant.SetField<byte[]>((object)user, "keyFile", (byte[])null); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", (string)null); PexInvariant.CheckInvariant((object)user); sInvestmentData = PexInvariant.CreateInstance<SInvestmentData>(); PexInvariant.SetField<uint> ((object)sInvestmentData, "investmentPercentage", 0u); PexInvariant.SetField<string>((object)sInvestmentData, "stockGroup", ""); PexInvariant.SetField<bool>((object)sInvestmentData, "__callBase", false); PexInvariant.SetField<IBehavior> ((object)sInvestmentData, "__instanceBehavior", (IBehavior)null); PexInvariant.CheckInvariant((object)sInvestmentData); InvestmentData[] investmentDatas1 = new InvestmentData[1]; investmentDatas1[0] = (InvestmentData)sInvestmentData; list1 = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas1); this.SaveData(user, list1); throw new AssertFailedException("expected an exception of type ContractException"); } catch(Exception ex) { if (!PexContract.IsContractException(ex)) throw ex; } }
public void VerifyAndExtendLoginSession226() { InvestmentData investmentData; List<InvestmentData> list; User user; bool b; investmentData = PexInvariant.CreateInstance<InvestmentData>(); PexInvariant.SetField<uint>((object)investmentData, "investmentPercentage", 0u); PexInvariant.SetField<string> ((object)investmentData, "stockGroup", (string)null); PexInvariant.CheckInvariant((object)investmentData); InvestmentData[] investmentDatas = new InvestmentData[2]; investmentDatas[0] = investmentData; investmentDatas[1] = investmentData; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<int>((object)user, "blockSize", 0); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", (byte[])null); PexInvariant.SetField<byte[]>((object)user, "keyFile", (byte[])null); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", (string)null); PexInvariant.CheckInvariant((object)user); b = this.VerifyAndExtendLoginSession(user); Assert.AreEqual<bool>(false, b); Assert.IsNotNull((object)user); Assert.AreEqual<int>(0, user.BlockSize); Assert.AreEqual<int>(1, user.ExpirationTime.Day); Assert.AreEqual<DayOfWeek>(DayOfWeek.Monday, user.ExpirationTime.DayOfWeek); Assert.AreEqual<int>(1, user.ExpirationTime.DayOfYear); Assert.AreEqual<int>(0, user.ExpirationTime.Hour); Assert.AreEqual<DateTimeKind> (DateTimeKind.Unspecified, user.ExpirationTime.Kind); Assert.AreEqual<int>(0, user.ExpirationTime.Millisecond); Assert.AreEqual<int>(0, user.ExpirationTime.Minute); Assert.AreEqual<int>(1, user.ExpirationTime.Month); Assert.AreEqual<int>(0, user.ExpirationTime.Second); Assert.AreEqual<int>(1, user.ExpirationTime.Year); Assert.AreEqual<decimal>(default(decimal), user.Funds); Assert.IsNull(user.IV); Assert.AreEqual<int>(0, user.Id); Assert.IsNotNull(user.InvestmentData); Assert.AreEqual<int>(2, user.InvestmentData.Capacity); Assert.AreEqual<int>(2, user.InvestmentData.Count); Assert.IsNull(user.KeyFile); Assert.AreEqual<string>((string)null, user.Name); }
public void FundsGet112() { List<InvestmentData> list; User user; decimal d; InvestmentData[] investmentDatas = new InvestmentData[0]; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<int>((object)user, "blockSize", 0); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", (byte[])null); PexInvariant.SetField<byte[]>((object)user, "keyFile", (byte[])null); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", (string)null); PexInvariant.CheckInvariant((object)user); d = this.FundsGet(user); Assert.AreEqual<decimal>(default(decimal), d); Assert.IsNotNull((object)user); Assert.AreEqual<int>(0, user.BlockSize); Assert.AreEqual<int>(1, user.ExpirationTime.Day); Assert.AreEqual<DayOfWeek>(DayOfWeek.Monday, user.ExpirationTime.DayOfWeek); Assert.AreEqual<int>(1, user.ExpirationTime.DayOfYear); Assert.AreEqual<int>(0, user.ExpirationTime.Hour); Assert.AreEqual<DateTimeKind> (DateTimeKind.Unspecified, user.ExpirationTime.Kind); Assert.AreEqual<int>(0, user.ExpirationTime.Millisecond); Assert.AreEqual<int>(0, user.ExpirationTime.Minute); Assert.AreEqual<int>(1, user.ExpirationTime.Month); Assert.AreEqual<int>(0, user.ExpirationTime.Second); Assert.AreEqual<int>(1, user.ExpirationTime.Year); Assert.AreEqual<decimal>(default(decimal), user.Funds); Assert.IsNull(user.IV); Assert.AreEqual<int>(0, user.Id); Assert.IsNotNull(user.InvestmentData); Assert.AreEqual<int>(0, user.InvestmentData.Capacity); Assert.AreEqual<int>(0, user.InvestmentData.Count); Assert.IsNull(user.KeyFile); Assert.AreEqual<string>((string)null, user.Name); }
public void ConstructorThrowsContractException31() { try { List<InvestmentData> list; User user; InvestmentData[] investmentDatas = new InvestmentData[0]; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); byte[] bs = new byte[0]; user = this.Constructor("\u0100", 0, default(decimal), list, bs, (ServerClass)null); throw new AssertFailedException("expected an exception of type ContractException"); } catch(Exception ex) { if (!PexContract.IsContractException(ex)) throw ex; } }
public void VerifyAndExtendLoginSession995() { List<InvestmentData> list; User user; bool b; InvestmentData[] investmentDatas = new InvestmentData[0]; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<int>((object)user, "blockSize", 0); PexInvariant.SetField<DateTime>((object)user, "expires", new DateTime(4611686018427387903L & 1214289598350306849L, (DateTimeKind)(1214289598350306849uL >> 62))); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", (byte[])null); PexInvariant.SetField<byte[]>((object)user, "keyFile", (byte[])null); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", (string)null); PexInvariant.CheckInvariant((object)user); b = this.VerifyAndExtendLoginSession(user); Assert.AreEqual<bool>(true, b); Assert.IsNotNull((object)user); Assert.AreEqual<int>(0, user.BlockSize); Assert.AreEqual<int>(6, user.ExpirationTime.Day); Assert.AreEqual<DayOfWeek>(DayOfWeek.Wednesday, user.ExpirationTime.DayOfWeek); Assert.AreEqual<int>(341, user.ExpirationTime.DayOfYear); Assert.AreEqual<int>(18, user.ExpirationTime.Hour); Assert.AreEqual<DateTimeKind> (DateTimeKind.Unspecified, user.ExpirationTime.Kind); Assert.AreEqual<int>(30, user.ExpirationTime.Millisecond); Assert.AreEqual<int>(37, user.ExpirationTime.Minute); Assert.AreEqual<int>(12, user.ExpirationTime.Month); Assert.AreEqual<int>(15, user.ExpirationTime.Second); Assert.AreEqual<int>(3848, user.ExpirationTime.Year); Assert.AreEqual<decimal>(default(decimal), user.Funds); Assert.IsNull(user.IV); Assert.AreEqual<int>(0, user.Id); Assert.IsNotNull(user.InvestmentData); Assert.AreEqual<int>(0, user.InvestmentData.Capacity); Assert.AreEqual<int>(0, user.InvestmentData.Count); Assert.IsNull(user.KeyFile); Assert.AreEqual<string>((string)null, user.Name); }
public void SaveDataThrowsNullReferenceException772() { SInvestmentData sInvestmentData; List<InvestmentData> list; User user; sInvestmentData = PexInvariant.CreateInstance<SInvestmentData>(); PexInvariant.SetField<uint>((object)sInvestmentData, "investmentPercentage", 0u); PexInvariant.SetField<string>((object)sInvestmentData, "stockGroup", ""); PexInvariant.SetField<bool>((object)sInvestmentData, "__callBase", false); PexInvariant.SetField<IBehavior> ((object)sInvestmentData, "__instanceBehavior", (IBehavior)null); PexInvariant.CheckInvariant((object)sInvestmentData); InvestmentData[] investmentDatas = new InvestmentData[1]; investmentDatas[0] = (InvestmentData)sInvestmentData; list = new List<InvestmentData>((IEnumerable<InvestmentData>)investmentDatas); user = PexInvariant.CreateInstance<User>(); PexInvariant.SetField<int>((object)user, "blockSize", 0); PexInvariant.SetField<DateTime>((object)user, "expires", default(DateTime)); PexInvariant.SetField<decimal>((object)user, "funds", default(decimal)); PexInvariant.SetField<int>((object)user, "id", 0); PexInvariant.SetField<List<InvestmentData>>((object)user, "investments", list); PexInvariant.SetField<byte[]>((object)user, "iv", (byte[])null); PexInvariant.SetField<byte[]>((object)user, "keyFile", (byte[])null); PexInvariant.SetField<ServerClass>((object)user, "server", (ServerClass)null); PexInvariant.SetField<string>((object)user, "username", (string)null); PexInvariant.CheckInvariant((object)user); this.SaveData(user, list); }
public InvestmentData Constructor(string stockGroup, uint investmentPercentage) { InvestmentData target = new InvestmentData(stockGroup, investmentPercentage); return target; // TODO: add assertions to method InvestmentDataTest.Constructor(String, UInt32) }