public void GenerateToken_returns_token_if_token_is_not_null([Frozen] TokenOptions options, FixedTokenExecutionTokenGeneratorAdapter sut, ProcessStartInfo startInfo, string token) { options.Token = token; var result = sut.GenerateToken(startInfo); Assert.That(result, Is.EqualTo(token)); }
public void GenerateToken_returns_from_inner_generator_if_token_is_null([Frozen] TokenOptions options, [Frozen] IExecutionTokenGenerator inner, FixedTokenExecutionTokenGeneratorAdapter sut, ProcessStartInfo startInfo, string token) { Mock.Get(inner).Setup(p => p.GenerateToken(It.IsAny <ProcessStartInfo>())).Returns(token); options.Token = null; var result = sut.GenerateToken(startInfo); Assert.That(result, Is.EqualTo(token)); }
public void GenerateToken_skips_inner_generator_if_token_is_not_null([Frozen] TokenOptions options, [Frozen] IExecutionTokenGenerator inner, FixedTokenExecutionTokenGeneratorAdapter sut, ProcessStartInfo startInfo, string token) { options.Token = token; _ = sut.GenerateToken(startInfo); Mock.Get(inner).Verify(p => p.GenerateToken(It.IsAny <ProcessStartInfo>()), Times.Never); }
public void GenerateToken_forwards_to_inner_generator_if_token_is_null([Frozen] TokenOptions options, [Frozen] IExecutionTokenGenerator inner, FixedTokenExecutionTokenGeneratorAdapter sut, ProcessStartInfo startInfo) { options.Token = null; _ = sut.GenerateToken(startInfo); Mock.Get(inner).Verify(p => p.GenerateToken(startInfo)); }