示例#1
0
        public void Returns_Https_When_Set()
        {
            var sut   = new RandomUrl(RandomUri.SchemeType.Https);
            var value = sut.GetValue();

            Assert.IsNotNull(value);

            var uri = new Uri(value);

            Assert.AreEqual("https", uri.Scheme);
        }
示例#2
0
        public void Returns_Configured_Domain_When_Set()
        {
            var sut   = new RandomUrl(RandomUri.SchemeType.Https, "net");
            var value = sut.GetValue();

            Assert.IsNotNull(value);

            var uri = new Uri(value);

            Assert.AreEqual("https", uri.Scheme);
            Assert.IsTrue(uri.Host.EndsWith(".net"));
        }
示例#3
0
        public void RandomUrlIsReturned()
        {
            var sut   = new RandomUrl();
            var value = sut.GetValue();

            Assert.IsNotNull(value);

            var uri = new Uri(value);

            Assert.IsFalse(string.IsNullOrEmpty(uri.Host));
            Assert.IsFalse(string.IsNullOrEmpty(uri.Scheme));
            Assert.IsFalse(string.IsNullOrEmpty(uri.PathAndQuery));
        }
示例#4
0
        public void exhibit_should_display_correct_date_december_in_bce()
        {
            var contentItemPdf = new ContentItem
            {
                Title       = RandomString.GetRandomString(1, 200),
                Caption     = RandomString.GetRandomString(1, 200),
                MediaSource = RandomUrl.GetRandomWebUrl(),
                MediaType   = "image",
                Attribution = RandomString.GetRandomString(1, 200),
                Uri         = RandomUrl.GetRandomImageUrl(),
                Order       = 0
            };
            const decimal year = -2015;

            _newExhibit = new Exhibit
            {
                Title        = RandomString.GetRandomString(1, 200),
                ContentItems = new Collection <ContentItem> {
                    contentItemPdf
                },

                Month       = "December",
                Day         = "31",
                Year        = ExhibitHelper.GetCoordinateFromYmd(year, 12, 31),
                Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314")
            };
            ApiHelper.CreateExhibitByApi(_newExhibit);
            HomePageHelper.OpenSandboxPage();
            ExhibitHelper.NavigateToExhibit(_newExhibit);
            string displayDate = ExhibitHelper.GetExhibitDisplayDate(_newExhibit);

            StringAssert.Contains(displayDate, "BCE");
            StringAssert.Contains(displayDate, year.ToString(CultureInfo.InvariantCulture));
            StringAssert.Contains(displayDate, _newExhibit.Day);
            if (GitHubIssueWatcher.IssueStatus.IsIssueResolved("1024"))
            {
                StringAssert.Contains(displayDate, DateTime.ParseExact(_newExhibit.Month, "MMMM", CultureInfo.InvariantCulture).Month.ToString(CultureInfo.InvariantCulture));
            }
        }