public static void LambdaAccessor_executes_null_lambda() { // Arrange var accessor = new LambdaAccessor <string>(() => null); // Act var actual = accessor.CorrelationId; // Assert Assert.Null(actual); }
public static void LambdaAccessor_returns_string_input(string expected) { // Arrange var accessor = new LambdaAccessor <string>(() => expected); // Act var actual = accessor.CorrelationId; // Assert Assert.Equal(expected, actual); }
public static void LambdaAccessor_executes_dynamic_lambda() { // Arrange var accessor = new LambdaAccessor <string>(MyLambda); // Act var actual = accessor.CorrelationId; // Assert Assert.True(Guid.TryParse(actual, out _)); string MyLambda() { return(Guid.NewGuid().ToString("D", CultureInfo.InvariantCulture)); } }
public static void LambdaAccessor_executes_static_lambda() { // Arrange var accessor = new LambdaAccessor <string>(MyLambda); // Act var actual = accessor.CorrelationId; // Assert Assert.Equal("123", actual); string MyLambda() { return("123"); } }