Exemple #1
0
        private void WhenAddingASingleAccountToADataStore_ItShouldBeAdded(CiphertextDatastoreBase ciphertextDatastore, int expectedCount)
        {
            // Given
            var fakeCiphertextDto = CiphertextFakeDataGenerator.GetFakeCiphertextDtoNotYetAdded();

            // When
            ciphertextDatastore.Save(fakeCiphertextDto);

            // Then
            ciphertextDatastore.GetAllIds()
            .Should().HaveCount(expectedCount);

            ciphertextDatastore.GetAll(CiphertextStatus.Any)
            .Should().HaveCount(expectedCount);

            ciphertextDatastore.GetAll(CiphertextStatus.Active)
            .Should().HaveCount(expectedCount);

            ciphertextDatastore.GetAll(CiphertextStatus.Deleted)
            .Should().HaveCount(0);

            VerifyThatStoredDataMatches(ciphertextDatastore, fakeCiphertextDto);
        }
        private void WhenAddingASingleAccountToADataStore_ItShouldBeAdded(CiphertextDatastoreBase ciphertextDatastore, int expectedCount)
        {
            // Given
            var fakeCiphertextDto = CiphertextFakeDataGenerator.GetFakeCiphertextDtoNotYetAdded();

            // When
            ciphertextDatastore.Save(fakeCiphertextDto);

            // Then
            ciphertextDatastore.GetAllIds()
                               .Should().HaveCount(expectedCount);

            ciphertextDatastore.GetAll(CiphertextStatus.Any)
                               .Should().HaveCount(expectedCount);

            ciphertextDatastore.GetAll(CiphertextStatus.Active)
                               .Should().HaveCount(expectedCount);

            ciphertextDatastore.GetAll(CiphertextStatus.Deleted)
                               .Should().HaveCount(0);

            VerifyThatStoredDataMatches(ciphertextDatastore, fakeCiphertextDto);
        }
Exemple #3
0
 public static void Populate(CiphertextDatastoreBase jsonCiphertextDatastore)
 {
     jsonCiphertextDatastore.Save(GetFakeCiphertextDto1());
     jsonCiphertextDatastore.Save(GetFakeCiphertextDto2());
 }