Ejemplo n.º 1
0
        public void EfficiencyDoesNotThrowExceptionIfWorkingTimeManagerIsNull()
        {
            var efficiencyCalculator = new EfficiencyCalculator(null);

            Assert.AreEqual(0, efficiencyCalculator.Efficiency);
            Assert.Pass();
        }
        public void EfficiencyTimeOnWorkIsZero()
        {
            IWorkingTimeManager workingTime = NewMock<IWorkingTimeManager>();
            Expect.Once.On(workingTime).GetProperty("TimeOnWork").Will(Return.Value(TimeSpan.Zero));

            EfficiencyCalculator efficiencyCalculator = new EfficiencyCalculator(workingTime);

            Assert.AreEqual(0, efficiencyCalculator.Efficiency);
        }
        public void Efficiency()
        {
            IWorkingTimeManager workingTime = NewMock<IWorkingTimeManager>();
            Expect.Once.On(workingTime).GetProperty("WorkingTasksTime").Will(Return.Value(TimeSpan.Parse("0:45")));
            Expect.Once.On(workingTime).GetProperty("TimeOnWork").Will(Return.Value(TimeSpan.Parse("1:00")));

            EfficiencyCalculator efficiencyCalculator = new EfficiencyCalculator(workingTime);

            Assert.AreEqual(0.75, efficiencyCalculator.Efficiency);
        }
Ejemplo n.º 4
0
        public void EfficiencyTimeOnWorkIsZero()
        {
            IWorkingTimeManager workingTime = NewMock <IWorkingTimeManager>();

            Expect.Once.On(workingTime).GetProperty("TimeOnWork").Will(Return.Value(TimeSpan.Zero));

            EfficiencyCalculator efficiencyCalculator = new EfficiencyCalculator(workingTime);

            Assert.AreEqual(0, efficiencyCalculator.Efficiency);
        }
Ejemplo n.º 5
0
        public void Efficiency()
        {
            IWorkingTimeManager workingTime = NewMock <IWorkingTimeManager>();

            Expect.Once.On(workingTime).GetProperty("WorkingTasksTime").Will(Return.Value(TimeSpan.Parse("0:45")));
            Expect.Once.On(workingTime).GetProperty("TimeOnWork").Will(Return.Value(TimeSpan.Parse("1:00")));

            EfficiencyCalculator efficiencyCalculator = new EfficiencyCalculator(workingTime);

            Assert.AreEqual(0.75, efficiencyCalculator.Efficiency);
        }
 public void EfficiencyDoesNotThrowExceptionIfWorkingTimeManagerIsNull()
 {
     var efficiencyCalculator = new EfficiencyCalculator(null);
     Assert.AreEqual(0, efficiencyCalculator.Efficiency);
     Assert.Pass();
 }