public void GivenEqualDateTimesWithIrrelevantPiecesWhenCurrentDateEqualsEndDateThenContestOverStringIsDisplayed()
        {
            var model = new MainContentPageViewModel();
            var endDateWithSecondsAccuracy         = new DateTime(2015, 6, 15, 0, 0, 0);
            var currentDateWithMillisecondAccuracy = new DateTime(2015, 6, 15, 0, 0, 0);

            currentDateWithMillisecondAccuracy.AddMilliseconds(200);

            Assert.AreEqual("Contest is over! Blast off!", model.ComposeCountdownString(endDateWithSecondsAccuracy, currentDateWithMillisecondAccuracy));
        }
Exemplo n.º 2
0
 public MainContentPage()
 {
     BindingContext = new MainContentPageViewModel();
     InitializeComponent();
 }
        public void WhenCurrentDateGreaterThanEndDateThenContestOverTextIsDisplayed()
        {
            var model = new MainContentPageViewModel();

            Assert.AreEqual("Contest is over! Blast off!", model.ComposeCountdownString(new DateTime(2015, 6, 15), new DateTime(2015, 6, 16, 1, 1, 1)));
        }
        public void GivenCurrentDateWithVariableMonthDayHourMinuteWhenCurrentDateLessThanEndDateThenCountdownStringIsCorrect()
        {
            var model = new MainContentPageViewModel();

            Assert.AreEqual("2 days, 3 hours, 4 minutes, 5 seconds", model.ComposeCountdownString(new DateTime(2015, 6, 15), new DateTime(2015, 6, 12, 20, 55, 55)));
        }
        public void WhenCurrentDateLessThanEndDateThenCoutdownStringIsComposed()
        {
            var model = new MainContentPageViewModel();

            Assert.AreEqual("1 days, 0 hours, 0 minutes, 0 seconds", model.ComposeCountdownString(new DateTime(2015, 6, 15), new DateTime(2015, 6, 14)));
        }
        public void WhenModelCreatedThenDefaultTextIsPresent()
        {
            var model = new MainContentPageViewModel();

            Assert.AreEqual("How long until the mobile app building contest ends?", model.MainText);
        }