public void SecretValueEmptyOnConstruction() { var mockList = new SecretsListBuilder().Build(); var objectList = mockList.Select(x => x.Object).ToList(); var sut = new EnumerateSecretShare("TargetKey", objectList); Assert.Empty(sut.SecretValue); }
public void SuccessfulFalseOnConstruction() { var mockList = new SecretsListBuilder().Build(); var objectList = mockList.Select(x => x.Object).ToList(); var sut = new EnumerateSecretShare("TargetKey", objectList); Assert.False(sut.Successful); }
public void ExceptionDuringSecretList() { var mockList = new SecretsListBuilder() .AddException() .Build(); var objectList = mockList.Select(x => x.Object).ToList(); var sut = new EnumerateSecretShare("TargetKey", objectList); sut.Exploit(); Assert.False(sut.Successful); Assert.Empty(sut.SecretValue); }
public void FailedExploit() { var mockList = new SecretsListBuilder() .AddInvalid() .Build(); var objectList = mockList.Select(x => x.Object).ToList(); var sut = new EnumerateSecretShare("TargetKey", objectList); sut.Exploit(); mockList.ForEach(x => x.VerifyAll()); Assert.False(sut.Successful); Assert.Empty(sut.SecretValue); }
public void SuccessfulExploit() { var mockList = new SecretsListBuilder() .AddValid() .Build(); var objectList = mockList.Select(x => x.Object).ToList(); var sut = new EnumerateSecretShare("TargetKey", objectList); sut.Exploit(); mockList.ForEach(x => x.VerifyAll()); Assert.True(sut.Successful); Assert.Equal("Secret1234", sut.SecretValue); }