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

MongoDB.Update - Fixed dll issue #21

Merged
merged 3 commits into from
Nov 24, 2023
Merged
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
4 changes: 4 additions & 0 deletions Frends.MongoDB.Update/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.0.1] - 2023-11-23
### Fixed
- Fixed dll error when importing the Task to Frends by adding local dll reference to the project file.

## [1.0.0] - 2022-11-01
### Added
- Initial implementation
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<PackageReference Include="coverlet.collector" Version="3.1.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.22.0" />
<PackageReference Include="MongoDB.Driver.Core" Version="2.22.0" />
<PackageReference Include="MongoDB.Bson" Version="2.22.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Frends.MongoDB.Update\Frends.MongoDB.Update.csproj" />
</ItemGroup>
Expand Down
24 changes: 24 additions & 0 deletions Frends.MongoDB.Update/Frends.MongoDB.Update.Tests/UnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,30 @@ public async Task Test_Update_File_UpdateMany()
Assert.IsTrue(GetDocuments("update").Equals(true));
RikuVirtanen marked this conversation as resolved.
Show resolved Hide resolved
}

[TestMethod]
public void Test_InvalidConnectionString()
{
var _input = new Input()
{
InputType = InputType.File,
UpdateOptions = Definitions.UpdateOptions.UpdateMany,
Filter = null,
Filters = null,
File = "..//..//..//Files//testdata.json",
UpdateString = "{$set: {foo:'update'}}"
};

var connection = new Connection
{
ConnectionString = "mongodb://admin:Incorrect@localhost:27017/?authSource=invalid",
CollectionName = _connection.CollectionName,
Database = _connection.Database,
};

var ex = Assert.ThrowsExceptionAsync<Exception>(async () => await MongoDB.Update(_input, connection, default));
Assert.IsTrue(ex.Result.Message.StartsWith("Update error: System.Exception: UpdateOperation error: MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1."));
}

private void InsertTestData()
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand All @@ -14,15 +14,38 @@
<PackageProjectUrl>https://frends.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.MongoDB</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Bson" Version="2.18.0" />
<PackageReference Include="MongoDB.Driver" Version="2.18.0" />
</ItemGroup>

<ItemGroup>
<None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="lib\MongoDB.Driver.dll" Pack="true" PackagePath="/lib/$(TargetFrameworks)">
<CopyToOutputDirectory>true</CopyToOutputDirectory>
</None>
<None Include="lib\MongoDB.Driver.Core.dll" Pack="true" PackagePath="/lib/$(TargetFrameworks)">
<CopyToOutputDirectory>true</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Bson" Version="2.22.0" />
<PackageReference Include="MongoDB.Libmongocrypt" Version="1.8.0" PrivateAssets="true" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="SharpCompress" Version="0.34.2" />
<PackageReference Include="Snappier" Version="1.1.2" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="ZstdSharp.Port" Version="0.7.3" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.300.7" />
<PackageReference Include="DnsClient" Version="1.7.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<Reference Include="MongoDB.Driver" Version="2.22.0">
<HintPath>lib\MongoDB.Driver.dll</HintPath>
</Reference>
<Reference Include="MongoDB.Driver.Core" Version="2.22.0">
<HintPath>lib\MongoDB.Driver.Core.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
Binary file not shown.
Binary file not shown.
Loading