1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

[PM-3555] Remove ClearTracker() (#3213)

* Remove ClearTracker

* Remove from CipherRepositoryTests
This commit is contained in:
Justin Baur
2023-10-12 05:15:02 -04:00
committed by GitHub
parent b2af73f00f
commit 79648b311e
6 changed files with 9 additions and 75 deletions

View File

@ -16,8 +16,7 @@ public class CipherRepositoryTests
[DatabaseTheory, DatabaseData]
public async Task DeleteAsync_UpdatesUserRevisionDate(
IUserRepository userRepository,
ICipherRepository cipherRepository,
ITestDatabaseHelper helper)
ICipherRepository cipherRepository)
{
var user = await userRepository.CreateAsync(new User
{
@ -34,8 +33,6 @@ public class CipherRepositoryTests
Data = "", // TODO: EF does not enforce this as NOT NULL
});
helper.ClearTracker();
await cipherRepository.DeleteAsync(cipher);
var deletedCipher = await cipherRepository.GetByIdAsync(cipher.Id);
@ -52,8 +49,7 @@ public class CipherRepositoryTests
IOrganizationUserRepository organizationUserRepository,
ICollectionRepository collectionRepository,
ICipherRepository cipherRepository,
ICollectionCipherRepository collectionCipherRepository,
ITestDatabaseHelper helper)
ICollectionCipherRepository collectionCipherRepository)
{
var user = await userRepository.CreateAsync(new User
{
@ -63,8 +59,6 @@ public class CipherRepositoryTests
SecurityStamp = "stamp",
});
helper.ClearTracker();
user = await userRepository.GetByIdAsync(user.Id);
var organization = await organizationRepository.CreateAsync(new Organization
@ -100,8 +94,6 @@ public class CipherRepositoryTests
},
});
helper.ClearTracker();
await Task.Delay(100);
await cipherRepository.CreateAsync(new CipherDetails
@ -128,8 +120,7 @@ public class CipherRepositoryTests
ICipherRepository cipherRepository,
IOrganizationRepository organizationRepository,
IOrganizationUserRepository organizationUserRepository,
IFolderRepository folderRepository,
ITestDatabaseHelper helper)
IFolderRepository folderRepository)
{
// This tests what happens when a cipher is moved into an organizations
var user = await userRepository.CreateAsync(new User
@ -171,8 +162,6 @@ public class CipherRepositoryTests
UserId = user.Id,
});
helper.ClearTracker();
// Move cipher to organization vault
await cipherRepository.ReplaceAsync(new CipherDetails
{