Skip to content

Commit

Permalink
Merge pull request #35 from M-Files/dependabot/nuget/MFaaP.MFWSClient…
Browse files Browse the repository at this point in the history
…/RestSharp-112.0.0

Bump RestSharp from 108.0.2 to 112.0.0 in /MFaaP.MFWSClient
  • Loading branch information
CraigHawker authored Sep 17, 2024
2 parents 0f068c5 + d4f6906 commit 39f1af8
Show file tree
Hide file tree
Showing 12 changed files with 433 additions and 365 deletions.
4 changes: 2 additions & 2 deletions MFaaP.MFWSClient.Tests/MFWSClient.Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void AuthenticateUsingSingleSignOn()
{
var options = new RestClientOptions();
options.BaseUrl = runner.RestClientMock.Object.BaseUrl;
runner.RestClientMock.Setup(m => m.Options).Returns(options);
runner.RestClientMock.Setup(m => m.Options).Returns(new ReadOnlyRestClientOptions(options));
var cookieContainer = new CookieContainer();
runner.RestClientMock.Setup(m => m.CookieContainer).Returns(cookieContainer);
}
Expand Down Expand Up @@ -110,7 +110,7 @@ public async Task AuthenticateUsingSingleSignOnAsync()
{
var options = new RestClientOptions();
options.BaseUrl = runner.RestClientMock.Object.BaseUrl;
runner.RestClientMock.Setup(m => m.Options).Returns(options);
runner.RestClientMock.Setup(m => m.Options).Returns(new ReadOnlyRestClientOptions(options));
var cookieContainer = new CookieContainer();
runner.RestClientMock.Setup(m => m.CookieContainer).Returns(cookieContainer);
}
Expand Down
2 changes: 1 addition & 1 deletion MFaaP.MFWSClient.Tests/MFWSClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static MFaaP.MFWSClient.MFWSClient GetMFWSClient(Moq.Mock<IRestClient> re
// Ensure that we have a default parameter collection, if it's not been mocked already.
if (null == restClientMoq.Object.DefaultParameters)
{
var defaultParameters = new ParametersCollection();
var defaultParameters = new DefaultParameters(new ReadOnlyRestClientOptions(new RestClientOptions()));
restClientMoq
.SetupGet(p => p.DefaultParameters)
.Returns(defaultParameters);
Expand Down
176 changes: 88 additions & 88 deletions MFaaP.MFWSClient.Tests/MFWSVaultObjectFileOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@ public async Task AddFilesAsync_CorrectResource()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<ExtendedObjectVersion>>
(
m => m.Data == new ExtendedObjectVersion()
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<ExtendedObjectVersion>(new RestRequest())
{
Data = new ExtendedObjectVersion()
}
);
});

// We also need to handle the upload file call or our tests will except.
Expand All @@ -439,17 +439,17 @@ public async Task AddFilesAsync_CorrectResource()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<UploadInfo>>
(
m => m.Data == new UploadInfo()
{
UploadID = 1
}
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<UploadInfo>(new RestRequest())
{
Data = new UploadInfo()
{
UploadID = 1
}
}
);
});

/* Act */
Expand Down Expand Up @@ -498,14 +498,14 @@ public void AddFiles_CorrectResource()
})
// Return a mock response.
.Returns(() =>
{
return Task.FromResult
(
Mock.Of<RestResponse<ExtendedObjectVersion>>
(
m => m.Data == new ExtendedObjectVersion()
)
);
{
return Task.FromResult
(
new RestResponse<ExtendedObjectVersion>(new RestRequest())
{
Data = new ExtendedObjectVersion()
}
);
});

// We also need to handle the upload file call or our tests will except.
Expand All @@ -514,17 +514,17 @@ public void AddFiles_CorrectResource()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<UploadInfo>>
(
m => m.Data == new UploadInfo()
{
UploadID = 1
}
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<UploadInfo>(new RestRequest())
{
Data = new UploadInfo()
{
UploadID = 1
}
}
);
});


Expand Down Expand Up @@ -578,14 +578,14 @@ public async Task AddFilesAsync_CorrectMethod()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<ExtendedObjectVersion>>
(
m => m.Data == new ExtendedObjectVersion()
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<ExtendedObjectVersion>(new RestRequest())
{
Data = new ExtendedObjectVersion()
}
);
});

// We also need to handle the upload file call or our tests will except.
Expand All @@ -594,17 +594,17 @@ public async Task AddFilesAsync_CorrectMethod()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<UploadInfo>>
(
m => m.Data == new UploadInfo()
{
UploadID = 1
}
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<UploadInfo>(new RestRequest())
{
Data = new UploadInfo()
{
UploadID = 1
}
}
);
});

/* Act */
Expand Down Expand Up @@ -657,10 +657,10 @@ public void AddFiles_CorrectMethod()
//Return the mock object.
return Task.FromResult
(
Mock.Of<RestResponse<ExtendedObjectVersion>>
(
m => m.Data == new ExtendedObjectVersion()
)
new RestResponse<ExtendedObjectVersion>(new RestRequest())
{
Data = new ExtendedObjectVersion()
}
);
});

Expand All @@ -670,17 +670,17 @@ public void AddFiles_CorrectMethod()
// Return a mock response.
.Returns(() =>
{
//Return the mock object.
return Task.FromResult
(
Mock.Of<RestResponse<UploadInfo>>
(
m => m.Data == new UploadInfo()
{
UploadID = 1
}
)
);
//Return the mock object.
return Task.FromResult
(
new RestResponse<UploadInfo>(new RestRequest())
{
Data = new UploadInfo()
{
UploadID = 1
}
}
);
});

/* Act */
Expand Down Expand Up @@ -830,14 +830,14 @@ public void RemoveFile_CorrectResource()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<ExtendedObjectVersion>>
(
m => m.Data == new ExtendedObjectVersion()
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<ExtendedObjectVersion>(new RestRequest())
{
Data = new ExtendedObjectVersion()
}
);
});


Expand Down Expand Up @@ -881,14 +881,14 @@ public async Task RemoveFileAsync_CorrectResource()
// Return a mock response.
.Returns(() =>
{
// Create the mock response.
return Task.FromResult
(
Mock.Of<RestResponse<ExtendedObjectVersion>>
(
m => m.Data == new ExtendedObjectVersion()
)
);
// Create the mock response.
return Task.FromResult
(
new RestResponse<ExtendedObjectVersion>(new RestRequest())
{
Data = new ExtendedObjectVersion()
}
);
});


Expand Down
Loading

0 comments on commit 39f1af8

Please sign in to comment.