コード例 #1
0
        public void From_AddsUrlToAllowedSources()
        {
            var builder = new CspWorkerBuilder();

            builder.From("www.google.com");
            CspWorkerSrcOptions options = builder.BuildOptions();

            Assert.Equal("www.google.com", options.AllowedSources.Single());
        }
コード例 #2
0
        public void From_ThrowsArgumentException_WithEmptyUrl()
        {
            var builder = new CspWorkerBuilder();

            Assert.Throws <ArgumentException>(() => builder.From(string.Empty));
        }
コード例 #3
0
        public void From_ThrowsArgumentNullException_WithNullUrl()
        {
            var builder = new CspWorkerBuilder();

            Assert.Throws <ArgumentNullException>(() => builder.From(null));
        }