public void InsertUniqueIdentifierWithAliases()
        {
            using (var db = GetSqlDatabase())
            {
                var p = new PersonUniqueIdentifierWithAliases {
                    GuidId = Guid.NewGuid(), First = "Alice", Last = "Jones"
                };
                Assert.True(db.Insert(p));
                var gp = db.Get <PersonUniqueIdentifierWithAliases>(p.GuidId);

                Assert.Equal(p.First, gp.First);
                Assert.Equal(p.Last, gp.Last);
            }
        }
Example #2
0
        public async Task InsertUniqueIdentifierWithAliasesAsync()
        {
            using (var connection = GetSqlDatabase())
            {
                var p = new PersonUniqueIdentifierWithAliases {
                    GuidId = Guid.NewGuid(), First = "Alice", Last = "Jones"
                };
                Assert.True(await connection.InsertAsync(p));
                var gp = await connection.GetAsync <PersonUniqueIdentifierWithAliases>(p.GuidId);

                Assert.Equal(p.First, gp.First);
                Assert.Equal(p.Last, gp.Last);
            }
        }
        public void DeleteUniqueIdentifierWithAliases()
        {
            using (var db = GetSqlDatabase())
            {
                var p = new PersonUniqueIdentifierWithAliases {
                    GuidId = Guid.NewGuid(), First = "Alice", Last = "Jones"
                };
                Assert.True(db.Insert(p));
                Assert.True(db.Delete(p));

                var gp = db.Get(p);
                Assert.Null(gp);
            }
        }
Example #4
0
        public async Task DeleteUniqueIdentifierWithAliasesAsync()
        {
            using (var connection = GetSqlDatabase())
            {
                var p = new PersonUniqueIdentifierWithAliases {
                    GuidId = Guid.NewGuid(), First = "Alice", Last = "Jones"
                };
                Assert.True(await connection.InsertAsync(p));
                Assert.True(await connection.DeleteAsync(p));

                var gp = await connection.GetAsync(p);

                Assert.Null(gp);
            }
        }