mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
Fix tests
This commit is contained in:
@ -172,7 +172,7 @@ public class CollectionsControllerTests
|
|||||||
.Returns(AuthorizationResult.Success());
|
.Returns(AuthorizationResult.Success());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await sutProvider.Sut.DeleteMany(model);
|
await sutProvider.Sut.DeleteMany(orgId, model);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await sutProvider.GetDependency<IDeleteCollectionCommand>()
|
await sutProvider.GetDependency<IDeleteCollectionCommand>()
|
||||||
@ -215,7 +215,7 @@ public class CollectionsControllerTests
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.ThrowsAsync<NotFoundException>(() =>
|
await Assert.ThrowsAsync<NotFoundException>(() =>
|
||||||
sutProvider.Sut.DeleteMany(model));
|
sutProvider.Sut.DeleteMany(orgId, model));
|
||||||
|
|
||||||
await sutProvider.GetDependency<IDeleteCollectionCommand>()
|
await sutProvider.GetDependency<IDeleteCollectionCommand>()
|
||||||
.DidNotReceiveWithAnyArgs()
|
.DidNotReceiveWithAnyArgs()
|
||||||
|
@ -113,6 +113,11 @@ public class CollectionServiceTest
|
|||||||
collection.Id = default;
|
collection.Id = default;
|
||||||
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
|
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
|
||||||
|
|
||||||
|
// TODO: move to customization / attribute
|
||||||
|
sutProvider.GetDependency<IFeatureService>()
|
||||||
|
.IsEnabled(FeatureFlagKeys.FlexibleCollections, Arg.Any<ICurrentContext>())
|
||||||
|
.Returns(true);
|
||||||
|
|
||||||
var ex = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.SaveAsync(collection, null, users));
|
var ex = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.SaveAsync(collection, null, users));
|
||||||
Assert.Contains("At least one member or group must have can manage permission.", ex.Message);
|
Assert.Contains("At least one member or group must have can manage permission.", ex.Message);
|
||||||
await sutProvider.GetDependency<ICollectionRepository>().DidNotReceiveWithAnyArgs().CreateAsync(default);
|
await sutProvider.GetDependency<ICollectionRepository>().DidNotReceiveWithAnyArgs().CreateAsync(default);
|
||||||
|
Reference in New Issue
Block a user