Ejemplo n.º 1
0
        private void ShouldStop_AfterReachingMinTemp()
        {
            var mockedTempChange = new Mock <Cooler>();
            var criteria         = new UntilFrozen <Solution>(mockedTempChange.Object);
            var mockedSolution   = new Mock <Solution>();

            Assert.True(criteria.ShouldStop(mockedSolution.Object));
        }
Ejemplo n.º 2
0
        private void ShouldNotStop_BeforeReachingMinTemp()
        {
            var mockedTempChange = new Mock <Cooler>();

            mockedTempChange.SetupProperty(s => s.Temperature, 2);
            var criteria       = new UntilFrozen <Solution>(mockedTempChange.Object);
            var mockedSolution = new Mock <Solution>();

            while (!criteria.ShouldStop(mockedSolution.Object))
            {
                mockedTempChange.Object.Temperature *= 0.5;
            }

            Assert.True(mockedTempChange.Object.Temperature <= UntilFrozen <Solution> .MIN_TEMP);
        }