Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drasticactions committed Oct 27, 2023
1 parent 765c6e6 commit e188647
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions src/FishyFlip.Tests/AuthorizedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright (c) Drastic Actions. All rights reserved.
// </copyright>

using FishyFlip.Models;
using Microsoft.Extensions.Logging.Debug;

namespace FishyFlip.Tests;
Expand All @@ -24,6 +23,53 @@ public AuthorizedTests()
this.proto.Server.CreateSessionAsync(handle, password).Wait();
}

[Fact]
public async Task GetPopularFeedGeneratorsAsync()
{
var result = await this.proto.Unspecced.GetPopularFeedGeneratorsAsync();
result.Switch(
success =>
{
Assert.True(success!.Feeds.Count() > 0);
},
failed =>
{
Assert.Fail($"{failed.StatusCode}: {failed.Detail}");
});
}

[Fact]
public async Task GetFeedAsyncTest()
{
var atUri = ATUri.Create("at://did:plc:hqmafuxb77d6cepxvqwlcekl/app.bsky.feed.generator/sandsky");
var result = await this.proto.Feed.GetFeedAsync(atUri);
result.Switch(
success =>
{
Assert.True(success!.Feed.Count() > 0);
},
failed =>
{
Assert.Fail($"{failed.StatusCode}: {failed.Detail}");
});
}

[Fact]
public async Task GetFeedGeneratorAsyncTest()
{
var atUri = ATUri.Create("at://did:plc:hqmafuxb77d6cepxvqwlcekl/app.bsky.feed.generator/sandsky");
var result = await this.proto.Feed.GetFeedGeneratorAsync(atUri);
result.Switch(
success =>
{
Assert.Equal(atUri.ToString(), success!.View.Uri.ToString());
},
failed =>
{
Assert.Fail($"{failed.StatusCode}: {failed.Detail}");
});
}

[Fact]
public async Task GetProfileAsyncTest()
{
Expand Down Expand Up @@ -61,8 +107,8 @@ public async Task GetProfilesAsyncWithHandlesTest()
[Fact]
public async Task GetProfilesAsyncWithDidTest()
{
var test1did = ATDid.Create("did:plc:7i5tmb4yfkznrn7whz4dg4gz");
var test2did = ATDid.Create("did:plc:wrrbtigjwpykuwzqsypnpazr");
var test1did = ATDid.Create("did:plc:ix37rgpewy5wtl5qzhunsldu");
var test2did = ATDid.Create("did:plc:adrmwce3psv74fm7p4tzf64k");
var result = await this.proto.Actor.GetProfilesAsync(new[] { test1did, test2did });
result.Switch(
success =>
Expand Down

0 comments on commit e188647

Please sign in to comment.