Esempio n. 1
0
        public async Task GetDefaultMachineNotSet()
        {
            var rep  = CreateMock <IConfigurationRepository>();
            var ctrl = new MachineController();

            rep.Get("Environment", "DefaultMachineID").Returns((Configuration)null);

            Assert.AreEqual(-1, await ctrl.GetDetaultMachine());
        }
Esempio n. 2
0
        public async Task GetDefaultMachine()
        {
            var rep  = CreateMock <IConfigurationRepository>();
            var ctrl = new MachineController();

            rep.Get("Environment", "DefaultMachineID").Returns(new Configuration {
                Value = "14"
            });
            int dm = await ctrl.GetDetaultMachine();

            Assert.AreEqual(14, dm);
        }