async void OnDeleteClicked(object sender, EventArgs e)
        {
            var todoItem = (NewItemPage)BindingContext;
            await ListDatabase.DeleteItemAsync(todoItem);

            await Navigation.PopAsync();
        }
Ejemplo n.º 2
0
        public async Task InitializedList()
        {
            var db = new ListDatabase();

            db.ListObject = new ListObject
            {
                Items = new RxList <ListItem> {
                    new ListItem {
                        StringProperty = "foo"
                    }
                }
            };
            await db.WaitForIdle();

            var stringNode = (DbValuePropertyNode)((ISexyDatabase)db).Node.EvaluatePath(nameof(ListDatabase.ListObject), nameof(ListObject.Items), "0", nameof(ListItem.StringProperty));
            var value      = File.ReadAllText(stringNode.File.FullName);

            Assert.AreEqual(db.ListObject.Items[0].StringProperty, value);
        }
Ejemplo n.º 3
0
        public async Task ItemLoaded()
        {
            var db = new ListDatabase();

            db.ListObject = new ListObject
            {
                Items = new RxList <ListItem>()
            };
            await db.WaitForIdle();

            var listNode      = (DbObjectListPropertyNode)((ISexyDatabase)db).Node.EvaluatePath(nameof(ListDatabase.ListObject), nameof(ListObject.Items));
            var itemDirectory = Path.Combine(listNode.Directory.FullName, "0");

            Directory.CreateDirectory(itemDirectory);
            var value      = "foo";
            var stringFile = new FileInfo(Path.Combine(itemDirectory, nameof(ListItem.StringProperty)));
            await db.EditFile(stringFile, value);

            Assert.AreEqual(value, db.ListObject.Items[0].StringProperty);
        }
Ejemplo n.º 4
0
 public ListDatabaseTest()
 {
     _database  = new ListDatabase <AggregateRootFake, IdFake>();
     _id        = new IdFake(10);
     _aggregate = new AggregateRootFake(_id);
 }