コード例 #1
0
        public async Task CreateNewKweet()
        {
            var profile = new Profile
            {
                Id          = new Guid("0001aec8-1fdd-42ae-b552-9cbfb693767e"),
                DisplayName = "John Doe",
                Avatar      = "Avatar.png"
            };

            await Context.Profiles.AddAsync(profile);

            await Context.SaveChangesAsync();

            var response = await _kweetService.CreateKweetAsync(profile.Id, "Test");

            Assert.True(response.Success);
        }
コード例 #2
0
        public async Task GetPaginatedKweets()
        {
            var profile = new Profile
            {
                Id          = new Guid("0001aec8-1fdd-42ae-b552-9cbfb693767e"),
                DisplayName = "John Doe",
                Avatar      = "Avatar.png"
            };

            await Context.Profiles.AddAsync(profile);

            await Context.SaveChangesAsync();

            await _kweetService.CreateKweetAsync(new Guid("0001aec8-1fdd-42ae-b552-9cbfb693767e"), "Test");

            await _kweetService.CreateKweetAsync(new Guid("0001aec8-1fdd-42ae-b552-9cbfb693767e"), "Test");

            var response = await _kweetService.GetPaginatedKweetsByProfile(0, 1, profile.Id);

            Assert.AreEqual(1, response.Data.Count());
        }