private void AddBadFormatTimespanWithDayBeforeMonth() { var timeClock = new TimeClock("testUsuario"); var badFormatDate = "20-10-2012 11:00"; timeClock.AddTime(badFormatDate); }
private void AddBadFormatTimespan() { var timeClock = new TimeClock("testUsuario"); var badFormatDate = "10-10-2012 111:00"; timeClock.AddTime(badFormatDate); }
public void AddTime_SomeTimespanWithPeriodAsHourMinutesSeparator() { var timeClock = new TimeClock("testUsuario"); var date = "10-20-2012 12.12"; //act timeClock.AddTime(date); //assert var actualTimespan = timeClock.CheckedTimes[0]; Assert.AreEqual(date, actualTimespan.ToString("MM-dd-yyyy hh.mm")); }
public void AddTime_SomeTimespan() { //arrange var timeClock = new TimeClock("testUsuario"); var date = "10-20-2012 12:12"; //act timeClock.AddTime(date); //assert var actualTimespan = timeClock.CheckedTimes[0]; Assert.AreEqual(date,actualTimespan.ToString("MM-dd-yyyy hh:mm")); }
public void PostClocking_WithoutKnownTimeClock_ShouldCreateATimeClock() { //arrange var clocking = new Clocking() { Date = "10-10-2012 11:11", UserName = "******" }; var expectedTimeClock = new TimeClock(clocking.UserName); expectedTimeClock.AddTime(clocking.Date); var mockTimeClockRepository = new Moq.Mock<ITimeClockRepository>(); mockTimeClockRepository.Setup(x => x.GetByUserName(clocking.UserName)).Returns<TimeClock>(null); mockTimeClockRepository.Setup(x => x.Store(expectedTimeClock)); var clockingController = new ClockingController(mockTimeClockRepository.Object); //act clockingController.PostClocking(clocking); //assert mockTimeClockRepository.VerifyAll(); }