Ejemplo n.º 1
0
        public void DllVersion_IsBogus()
        {
            var vbe      = new MockVbeBuilder().Build();
            var registry = GetRegistryMock();

            vbe.SetupGet(s => s.Version).Returns("foo");
            var settings = new VBESettings(vbe.Object, registry.Object);

            Assert.AreEqual(DllVersion.Unknown, settings.Version);
        }
Ejemplo n.º 2
0
        public void DllVersion_IsNull()
        {
            var vbe      = new MockVbeBuilder().Build();
            var registry = GetRegistryMock();

            vbe.SetupGet(s => s.Version).Returns((string)null);
            var settings = new VBESettings(vbe.Object, registry.Object);

            Assert.IsTrue(settings.Version == DllVersion.Unknown);
        }
Ejemplo n.º 3
0
        public void DllVersion_MustBe7()
        {
            var vbe      = new MockVbeBuilder().Build();
            var registry = GetRegistryMock();

            vbe.SetupGet(s => s.Version).Returns("7.00");
            var settings = new VBESettings(vbe.Object, registry.Object);

            Assert.AreEqual(DllVersion.Vbe7, settings.Version);
        }
Ejemplo n.º 4
0
        public void BackGroundCompile_Write_IsFalse()
        {
            var vbe      = new MockVbeBuilder().Build();
            var registry = GetRegistryMock();

            vbe.SetupGet(s => s.Version).Returns("7.00");
            registry.Setup(s => s.SetValue(Vbe7SettingPath, "BackGroundCompile", false, RegistryValueKind.DWord));
            registry.Setup(s => s.GetValue(Vbe7SettingPath, "BackGroundCompile", DWordFalseValue)).Returns(DWordFalseValue);

            var settings = new VBESettings(vbe.Object, registry.Object);

            settings.BackGroundCompile = false;
            Assert.IsTrue(settings.BackGroundCompile == false);
        }
Ejemplo n.º 5
0
        public void CompileOnDemand_Write_IsTrue()
        {
            var vbe      = new MockVbeBuilder().Build();
            var registry = GetRegistryMock();

            vbe.SetupGet(s => s.Version).Returns("7.00");
            registry.Setup(s => s.SetValue(Vbe7SettingPath, "CompileOnDemand", true, RegistryValueKind.DWord));
            registry.Setup(s => s.GetValue(Vbe7SettingPath, "CompileOnDemand", DWordFalseValue)).Returns(DWordTrueValue);

            var settings = new VBESettings(vbe.Object, registry.Object);

            settings.CompileOnDemand = true;
            Assert.IsTrue(settings.CompileOnDemand);
        }