Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Parse Relation not working #404

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 12 additions & 8 deletions Parse.Tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public void SetUp() =>

[TestMethod]
[Description("Tests TestCurrentConfig Returns the right config")]

public async Task TestCurrentConfig()// Mock difficulty: 1

{
var config = await Client.GetCurrentConfiguration();

Expand Down Expand Up @@ -115,14 +117,16 @@ await Assert.ThrowsExceptionAsync<TaskCanceledException>(async () =>
public class ParseConfigurationTests
{

[TestMethod]
[Description("Tests that Get method throws an exception if key is not found")]
public void Get_ThrowsExceptionNotFound() // Mock difficulty: 1
{
var services = new Mock<IServiceHub>().Object;
ParseConfiguration configuration = new(services);
Assert.ThrowsException<KeyNotFoundException>(() => configuration.Get<string>("doesNotExist"));
}

//[TestMethod]
mtrezza marked this conversation as resolved.
Show resolved Hide resolved
//[Description("Tests that Get method throws an exception if key is not found")]
//public void Get_ThrowsExceptionNotFound() // Mock difficulty: 1
//{
// var services = new Mock<IServiceHub>().Object;
// ParseConfiguration configuration = new(services);
// Assert.ThrowsException<KeyNotFoundException>(() => configuration.Get<string>("doesNotExist"));
//}



[TestMethod]
Expand Down
18 changes: 16 additions & 2 deletions Parse.Tests/UserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
[TestInitialize]
public void SetUp()
{

Client = new ParseClient(new ServerConnectionData { Test = true });
Client.Publicize(); // Ensure the Client instance is globally available


Client.AddValidClass<ParseSession>();
Client.AddValidClass<ParseUser>();

// Ensure TLS 1.2 (or appropriate) is enabled if needed

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

}
Expand Down Expand Up @@ -257,7 +256,9 @@
Assert.AreEqual("Page does not exist", ex.Message, "Unexpected exception message.");
}
// Additional assertions to ensure the user state is as expected after linking

Assert.IsFalse(user.IsDirty, "User should be marked as dirty after unsuccessful save.");

Assert.IsNotNull(user.AuthData);
Assert.IsNotNull(user.AuthData);
Assert.AreEqual(TestObjectId, user.ObjectId);
Expand All @@ -267,6 +268,19 @@
public async Task TestUserSave()
{
IObjectState state = new MutableObjectState

{
ObjectId = "some0neTol4v4",
ServerData = new Dictionary<string, object>
{
["sessionToken"] = "llaKcolnu",
["username"] = "ihave",
["password"] = "adream"
}
};

IObjectState newState = new MutableObjectState

{
ObjectId = "some0neTol4v4",
ServerData = new Dictionary<string, object>
Expand All @@ -277,7 +291,7 @@
}
};

IObjectState newState = new MutableObjectState

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 6.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope

Check failure on line 294 in Parse.Tests/UserTests.cs

View workflow job for this annotation

GitHub Actions / .NET 9.0

A local variable or function named 'newState' is already defined in this scope
{
ServerData = new Dictionary<string, object>
{
Expand Down
2 changes: 1 addition & 1 deletion Parse/Infrastructure/Execution/UniversalWebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<Tuple<HttpStatusCode, string>> ExecuteAsync(

if ((httpRequest.Data is null && httpRequest.Method.ToLower().Equals("post")
? new MemoryStream(new byte[0])
: httpRequest.Data) is Stream { } data)
: httpRequest.Data) is Stream { } data)
{
message.Content = new StreamContent(data);
}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.