-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIsUrlTest.java
More file actions
28 lines (23 loc) · 951 Bytes
/
IsUrlTest.java
File metadata and controls
28 lines (23 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.aspose.html.tests;
import com.aspose.html.Utils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.stream.Stream;
public class IsUrlTest {
private static Stream<Arguments> data() {
return Stream.of(
Arguments.of("https://www.youtube.com/watch?v=3MtCoqTqPW0", true),
Arguments.of("https://www.facebook.com/", true),
Arguments.of("https://ru.wikipedia.org/wiki/DAC", true),
Arguments.of("www.facebook.com", false),
Arguments.of("mailto:example.com", false)
);
}
@ParameterizedTest
@MethodSource("data")
public void isUrl(String input, boolean expected) {
Assertions.assertEquals(expected, Utils.isURI(input));
}
}