示例#1
0
        public async Task UnfluffUrl_ThrowsArgumentException_WhenUrlInvalid()
        {
            const string invalidUrl = "invalid";
            Unfluffer    unfluffer  = new Unfluffer();

            await Assert.ThrowsAsync <ArgumentException>(() => unfluffer.UnfluffUrlAsync(invalidUrl));
        }
示例#2
0
        public async Task UnfluffUrl_ReturnsPayload_WhenUrlRequiresNormalization()
        {
            const string urlMissingHttp = "stackoverflow.com";
            Unfluffer    unfluffer      = new Unfluffer();

            Payload result = await unfluffer.UnfluffUrlAsync(urlMissingHttp);

            Assert.NotNull(result);
            Assert.NotEmpty(result.Title);
        }
示例#3
0
        public async Task UnfluffUrl_ReturnsPayload_WhenSuccessful()
        {
            const string validUrl  = "https://slack.com/pricing";
            Unfluffer    unfluffer = new Unfluffer();

            Payload result = await unfluffer.UnfluffUrlAsync(validUrl);

            Assert.NotNull(result);
            Assert.NotEmpty(result.Title);
            Assert.NotEmpty(result.Language);
        }
示例#4
0
        public async Task UnfluffUrl_ThrowsArgumentNullException_WhenUrlIsNull()
        {
            Unfluffer unfluffer = new Unfluffer();

            await Assert.ThrowsAsync <ArgumentNullException>(() => unfluffer.UnfluffUrlAsync(null));
        }