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); }