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); }
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); }
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); }
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); }
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); }