Exemplo n.º 1
0
        public async Task NoCredentialsAreStored_NullReturned(
            Application.CredentialsNS.CredentialsRepository credentialsRepository)
        {
            // arrange

            // act
            var loadedCredentials = await credentialsRepository.LoadAsync();

            // assert
            loadedCredentials.Should().BeNull();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }