Beispiel #1
0
        public void InstallSharpAttributeTakesSecondPrecedence()
        {
            var assembly = GetType().Assembly;

            // Setup
            var config = ApplicationUpdaterConfigFactory.Create(null, null, assembly);

            // Verify assert we pick up the correct GUID
            Assert.Equal(new Guid("2607EA54-696D-4411-9F95-661C1FA6F626"), config.Guid);
        }
Beispiel #2
0
        public void PassedConfigurationTakesFirstPrecendence()
        {
            // Setup
            var args = new ApplicationUpdaterConfig {
                Guid = new Guid("55E21349-157D-4ADC-83ED-B47AE1CDB7E4")
            };
            var config = ApplicationUpdaterConfigFactory.Create(args, null, GetType().Assembly);

            // Verify assert we pick up the correct GUID
            Assert.Equal(new Guid("55E21349-157D-4ADC-83ED-B47AE1CDB7E4"), config.Guid);
        }
Beispiel #3
0
        public void UseAssemblyGuidByDefault()
        {
            // Use the InstallSharp assembly, as it has a GUID attribute but no InstallSharp attribute. If we use the unit test assembly,
            // it has an InstallSharp attribute which will take precendence and not use the GUID attribute.
            var assembly = typeof(ApplicationUpdater).Assembly;

            // Setup
            var config = ApplicationUpdaterConfigFactory.Create(null, null, assembly);

            // Verify assert we pick up the correct GUID
            Assert.Equal(new Guid("55C2CFC0-A66A-4E54-A516-7483C4A57D9E"), config.Guid);
        }
        public void InferredDefaults()
        {
            // As we're running in UnitTest, infer defaults from the specified InstallSharp assembly instead of the Unit Test host
            var assembly = typeof(ApplicationUpdater).Assembly;
            var info     = FileVersionInfo.GetVersionInfo(assembly.Location);

            // Execute
            var args = ApplicationUpdaterConfigFactory.Create(null, info, assembly);

            // Verify
            Assert.Equal("InstallSharp", args.Name);
            Assert.Equal("InstallSharp.dll", args.FileName);
            Assert.Equal("InstallSharp.dll", args.AssetName);
            Assert.Equal(assembly.Location, args.FullFileName);
            Assert.Equal("InstallSharp", args.ProductName);
            Assert.Equal("Robo Kiwi", args.CompanyName);
            Assert.Equal(info.FileVersion, args.Version);
            Assert.Equal(new Guid("55C2CFC0-A66A-4E54-A516-7483C4A57D9E"), args.Guid);

            Assert.Equal(Environment.ExpandEnvironmentVariables("%LocalAppData%\\Programs\\InstallSharp"), args.InstallPath);

            Assert.Equal("github.com/RoboKiwi/InstallSharp", args.UpdateUrl);
        }
 public void CommandLine()
 {
     var config = ApplicationUpdaterConfigFactory.Create(null, null, null);
 }