public void CanGetDtoForDictionary() { Type dtoType = Dto.TypeFor("TestType", GetTestDictionary()); Expect.IsNotNull(dtoType); Expect.AreEqual(3, dtoType.GetProperties().Length); Pass("dtoTypeFor"); }
public void ShouldBeAbleToBackupWithDatabaseBackup() { SQLiteDatabase toBackup = GetTestDatabase("backup_"); DaoBackup backup = new DaoBackup(typeof(MainObject).Assembly, toBackup); backup.Backup(); MainObject one = MainObject.FirstOneWhere(c => c.Id > 0, toBackup); IRepository repo = backup.BackupRepository; object fromRepo = repo.Retrieve(Dto.TypeFor(one), one.Uuid); Expect.AreEqual(one.Uuid, fromRepo.Property("Uuid")); Expect.AreEqual(one.Name, fromRepo.Property("Name")); OutLine(fromRepo.TryPropertiesToString(), ConsoleColor.DarkBlue); OutLine("Dto types defined in repo are: ", ConsoleColor.DarkCyan); repo.StorableTypes.Each(t => { OutLineFormat("Namespace: {0}, Name: {1}", t.Namespace, t.Name); }); }