Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions Gorse.NET.Tests/UnitTests/TestUsersAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public void TestUserLifecycle()
{
UserId = "user123",
Labels = new string[] { "outgoing", "optimistic", "creative" },
Comment = "Initial user creation",
Subscribe = new string[] { "news", "updates", "offers" }
Comment = "Initial user creation"
};
var rowAffected = client.InsertUser(user);
Assert.That(rowAffected.RowAffected, Is.EqualTo(1));
Expand All @@ -29,7 +28,6 @@ public void TestUserLifecycle()
// Update the user with new details
user.Labels = new string[] { "introverted", "thoughtful", "analytical" };
user.Comment = "Updated user profile";
user.Subscribe = new string[] { "promotions", "alerts", "newsletters" };
rowAffected = client.UpdateUser(user.UserId, user);
Assert.That(rowAffected.RowAffected, Is.EqualTo(1));

Expand Down Expand Up @@ -72,7 +70,6 @@ public async Task TestUserLifecycleAsync()
// Update the user with new details
user.Labels = new string[] { "introverted", "thoughtful", "analytical" };
user.Comment = "Updated user profile"; // Updated comment
user.Subscribe = new string[] { "promotions", "alerts", "newsletters" };
rowAffected = await client.UpdateUserAsync(user.UserId, user);
Assert.That(rowAffected.RowAffected, Is.EqualTo(1));

Expand Down Expand Up @@ -105,14 +102,12 @@ public void TestUsersBatch()
new User{
UserId = "user123",
Labels = new string[] { "outgoing", "optimistic", "creative" },
Comment = "Initial user creation",
Subscribe = new string[] { "news", "updates", "offers" }
Comment = "Initial user creation"
},
new User{
UserId = "user456",
Labels = new string[] { "introverted", "thoughtful", "analytical" },
Comment = "Second user creation",
Subscribe = new string[] { "promotions", "alerts", "newsletters" }
Comment = "Second user creation"
},
};

Expand Down Expand Up @@ -158,14 +153,12 @@ public async Task TestUsersBatchAsync()
new User{
UserId = "user123",
Labels = new string[] { "outgoing", "optimistic", "creative" },
Comment = "Initial user creation",
Subscribe = new string[] { "news", "updates", "offers" }
Comment = "Initial user creation"
},
new User{
UserId = "user456", // Descriptive UserId
Labels = new string[] { "introverted", "thoughtful", "analytical" },
Comment = "Second user creation",
Subscribe = new string[] { "promotions", "alerts", "newsletters" }
Comment = "Second user creation"
},
};

Expand Down
1 change: 0 additions & 1 deletion Gorse.NET/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class User
public string UserId { set; get; } = "";
public string[] Labels { set; get; } = Array.Empty<string>();
public string Comment { get; set; } = "";
public string[] Subscribe { get; set; } = Array.Empty<string>();
public override bool Equals(object? obj) => obj is User other && this.Equals(other);

public bool Equals(User user) => UserId.Equals(user.UserId) && Enumerable.SequenceEqual(Labels, user.Labels);
Expand Down
Loading