private ItemData CreateFullItem() { var fullItem = new ItemData(); fullItem.CreateUuid(); fullItem.SetTitle("a-title"); fullItem.Password = "******"; fullItem.User = "******"; fullItem.Notes = "N is for notes\nwhich can span lines\r\nin several ways."; fullItem.Group = "Groups.are.nested.by.dots"; fullItem.Url = "http://pwsafe.org/"; fullItem.AutoType = "\\u\\t\\t\\n\\p\\t\\n"; fullItem.Email = "*****@*****.**"; fullItem.PolicyName = "liberal"; fullItem.Symbols = "<-_+=@?>"; fullItem.RunCommand = "Run 4 your life"; fullItem.LastAccessTime = new DateTime(2014, 9, 5, 9, 14, 52); fullItem.CreationTime = new DateTime(2014, 9, 5, 9, 14, 53); fullItem.PasswordExpiryTime = new DateTime(2014, 9, 5, 9, 14, 54); fullItem.LastPasswordChangeTime = new DateTime(2014, 9, 5, 9, 14, 55); fullItem.LastOtherValueChangeTime = new DateTime(2014, 9, 5, 9, 14, 56); fullItem.Dca = 3; fullItem.ShiftDca = 8; fullItem.KbShortcut = 0x12345678; return(fullItem); }
public async Task PwsFileV3_ItemData_UnkownFields_ArePersisted() { var d1 = new ItemData(); d1.CreateUuid(); d1.Title = "future"; d1.Password = "******"; var uv = new byte[] { 55, 42, 78, 30, 16, 93 }; d1.SetUnknownField(Item.FieldType.UnknownTesting, uv); var ms = new MemoryStream(); var pws = new PwsFileV3(ms, CreatePasskey(), FileMode.Create); await pws.OpenAsync(); await pws.WriteRecordAsync(d1); pws.Dispose(); ms.Position = 0; var read = (PwsFileV3)await PwsFile.OpenAsync(ms, CreatePasskey()); var item = await read.ReadRecordAsync(); Assert.AreEqual(d1, item); Assert.IsNull(await read.ReadRecordAsync()); read.Dispose(); }
private ItemData CreateSmallItem() { var smallItem = new ItemData(); smallItem.CreateUuid(); smallItem.SetTitle("picollo"); smallItem.Password = "******"; return(smallItem); }