public void GetDeliveringVolume_SingleHose_ReturnsHoseDeliveringVolume()
        {
            var forecourt = new EZTech(new EZTechMockIO());

            var volume = forecourt.GetDeliveringVolume(new Hose(1));
            forecourt.Dispose();

            volume.Should().Be(243.943d);
        }
        public void GetPrice_SingleHose_ReturnsHosePrice()
        {
            var forecourt = new EZTech(new EZTechMockIO());

            var price = forecourt.GetPrice(new Hose(1));
            forecourt.Dispose();

            price.Should().Be(2.890d);
        }
        public void GetTotalVolume_SingleHose_ReturnsHoseTotalVolume()
        {
            var forecourt = new EZTech(new EZTechMockIO());

            var volume = forecourt.GetTotalVolume(new Hose(1));
            forecourt.Dispose();

            volume.Should().Be(240753.88d);
        }
        public void Authorise_SingleHose_AuthoriseHose()
        {
            var mock = new EZTechMockIO();
            var forecourt = new EZTech(mock);

            forecourt.Authorise(new Hose(1));
            forecourt.Dispose();

            var tuple = new Tuple<int, short>(1, 3);
            mock.SetPumpPropertiesExecutions.ContainsKey(tuple).Should().Be(true);
            mock.SetPumpPropertiesExecutions[tuple].Should().Be.GreaterThan(0);
        }
        public void GetPumpsState_PumpList_ReturnsPumpStateForEachPump()
        {
            var forecourt = new EZTech(new EZTechMockIO());
            var pump1 = new Pump(1);
            var pump2 = new Pump(2);
            var pumpList = new List<Pump>() { pump1, pump2 };

            var dic = forecourt.GetPumpsState(pumpList);
            forecourt.Dispose();

            dic[pump1].Should().Be(PumpState.Delivering);
            dic[pump2].Should().Be(PumpState.Free);
        }
        public void GetDeliveringVolume_HoseList_ReturnsDeliveringVolumeForEachHose()
        {
            var forecourt = new EZTech(new EZTechMockIO());
            var hose1 = new Hose(1);
            var hose2 = new Hose(2);
            var hoseList = new List<Hose>() { hose1, hose2 };

            var dic = forecourt.GetDeliveringVolume(hoseList);
            forecourt.Dispose();

            dic[hose1].Should().Be(243.943d);
            dic[hose2].Should().Be(20.752d);
        }
        public void SetPrice_SingleHoseAndSomeValue_SetsHosePriceWithSpecifiedValue()
        {
            var mock = new EZTechMockIO();
            var forecourt = new EZTech(mock);

            forecourt.SetPrice(new Hose(1), 3.784);
            forecourt.Dispose();

            var tuple = new Tuple<int, double>(1, 3.784);
            mock.SetHosePricesExecutions.ContainsKey(tuple).Should().Be(true);
            mock.SetHosePricesExecutions[tuple].Should().Be.GreaterThan(0);
        }
        public void SetClock_DateTimeValues_SetsClockWithSpecifiedDateTimeValues()
        {
            var mock = new EZTechMockIO();
            var forecourt = new EZTech(mock);
            var newDateTime = new DateTime(2012, 6, 7, 15, 23, 0);

            forecourt.SetClock(newDateTime);
            forecourt.Dispose();

            mock.SetDateTimeExecutions.ContainsKey(newDateTime).Should().Be(true);
            mock.SetDateTimeExecutions[newDateTime].Should().Be.GreaterThan(0);
        }
        public void PresetByVolume_SingleHoseAndSomeVolume_PresetHoseWithSpecifiedVolume()
        {
            var mock = new EZTechMockIO();
            var forecourt = new EZTech(mock);

            forecourt.PresetByVolume(new Hose(1), 158d);
            forecourt.Dispose();

            var tuple = new Tuple<int, short, double, short>(1, 3, 158d, 1);
            mock.LoadPresetExecutions.ContainsKey(tuple).Should().Be(true);
            mock.LoadPresetExecutions[tuple].Should().Be.GreaterThan(0);
        }