Beispiel #1
0
        public async Task WriteReadHostTests()
        {
            var e = new WatchEntity {
                WatchId             = Guid.NewGuid(),
                Emails              = Guid.NewGuid().ToString(),
                Host                = Guid.NewGuid().ToString(),
                PingIntervalSeconds = 1000
            };
            var result = await RepoContext.AddAsync(e);

            await RepoContext.SaveChangesAsync();

            Assert.AreEqual(e.WatchId, result.Entity.WatchId);
        }
Beispiel #2
0
        public async Task DeleteHostTests()
        {
            var e = new WatchEntity
            {
                WatchId             = Guid.NewGuid(),
                Emails              = Guid.NewGuid().ToString(),
                Host                = Guid.NewGuid().ToString(),
                PingIntervalSeconds = 1000
            };

            var result = await RepoContext.AddAsync(e);

            await RepoContext.SaveChangesAsync();

            Assert.AreEqual(e.WatchId, result.Entity.WatchId);

            await RepoContext.Remove(e.WatchId);

            var e2 = await RepoContext.GetItem(e.WatchId);

            Assert.IsNull(e2);
        }