public async Task NoCredentialsAreStored_NullReturned( Application.CredentialsNS.CredentialsRepository credentialsRepository) { // arrange // act var loadedCredentials = await credentialsRepository.LoadAsync(); // assert loadedCredentials.Should().BeNull(); }
public async Task CredentialsAreStored_CredentialsAreLoaded( Application.CredentialsNS.CredentialsRepository credentialsRepository) { // arrange var storedCredentials = new Credentials("TestUsername", "TestPassword"); await credentialsRepository.StoreAsync(storedCredentials); // act var loadedCredentials = await credentialsRepository.LoadAsync(); // assert loadedCredentials.Should().Be(storedCredentials); }
public async Task StoringCredentialsTwice_ShouldLoadLatestCredentials( [Frozen] ICredentialsStorageProvider storageProvider, Application.CredentialsNS.CredentialsRepository credentialsRepository) { // arrange var firstCredentials = new Credentials("AAA", "BBB"); var secondCredentials = new Credentials("Z", "Y"); // act await credentialsRepository.StoreAsync(firstCredentials); await credentialsRepository.StoreAsync(secondCredentials); var loadedCredentials = await credentialsRepository.LoadAsync(); // assert loadedCredentials.Should().Be(secondCredentials); }