예제 #1
0
        public async Task TestUpdateAsync()
        {
            await using var context = new EspeonDbContext(this._options);
            var tags = await context.IncludeAndFindAsync <GuildTags, GuildTag, ulong>(
                GuildId,
                tags => tags.Values);

            tags.Values.Add(new GuildTag(GuildId, "espeon", "tag", UserId));
            await context.UpdateAsync(tags);

            var tags2 = await context.IncludeAndFindAsync <GuildTags, GuildTag, ulong>(
                GuildId,
                tags => tags.Values);

            CollectionAssert.AreEquivalent(tags.Values, tags2.Values);
        }
예제 #2
0
        public async Task TestFindAndIncludeAsync()
        {
            await using var context = new EspeonDbContext(this._options);
            var tags = await context.IncludeAndFindAsync <GuildTags, GuildTag, ulong>(
                GuildId,
                tags => tags.Values);

            Assert.NotNull(tags);
            Assert.NotNull(tags.Values);
        }