Beispiel #1
0
        public void AddSecretMethodSadPath()
        {
            var source = new SecretsConfigurationSource();

            var builder = new SecretsConfigurationBuilder(source);

            Action act = () => builder.AddSecret(null);

            act.Should().ThrowExactly <ArgumentNullException>().WithMessage("*secret*");
        }
Beispiel #2
0
        public void AddSecretMethodHappyPath()
        {
            var source = new SecretsConfigurationSource();

            var builder = new SecretsConfigurationBuilder(source);

            var secret = MockSecret.Get("foo", "bar").Object;

            builder.AddSecret(secret);

            source.Secrets.Should().ContainSingle()
            .Which.Should().BeSameAs(secret);
        }