Пример #1
0
        public void LowerSymbolOneYear()
        {
            CopyrightInfo copyright = new CopyrightInfo(false,
                                                        "Authors, Inc.", 2007);

            Assert.AreEqual("Copyright (c) 2007 Authors, Inc.", copyright.ToString());
        }
Пример #2
0
        public void UpperSymbolTwoConsecutiveYears()
        {
            CopyrightInfo copyright = new CopyrightInfo(true,
                                                        "X & Y Group", 2006, 2007);

            Assert.AreEqual("Copyright (C) 2006, 2007 X & Y Group", copyright.ToString());
        }
        public void Should_not_grow_when_converted_to_string()
        {
            var info = new CopyrightInfo("ManOnTheMoon, Inc.", 2019);

            for (int i = 0; i < 10; i++)
            {
                info.ToString().Length.Should().Be(37);
            }
        }
Пример #4
0
        public void Should_not_grow_when_converted_to_string()
        {
            var info = new CopyrightInfo ("ManOnTheMoon, Inc.", 2019);

            for (int i=0; i<10; i++)
            {
                info.ToString().Length.Should().Be(37);
            }
        }
Пример #5
0
        public void ShouldNotGrowWhenConvertedToString()
        {
            var info = new CopyrightInfo ("ManOnTheMoon, Inc.", 2019);

            for (int i=0; i<10; i++)
            {
                info.ToString().Length.Should().Equal(37);
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            var ass       = Assembly.GetExecutingAssembly();
            var fvi       = FileVersionInfo.GetVersionInfo(ass.Location);
            var Heading   = new HeadingInfo(fvi.FileDescription, ass.GetName().Version.ToString());
            var Copyright = new CopyrightInfo(fvi.CompanyName, DateTime.Today.Year);

            Parser.Default.ParseArguments <Options>(args).WithParsed(o =>
            {
                Console.WriteLine(Heading.ToString());
                Console.WriteLine(Copyright.ToString());
                Console.WriteLine();

                if (!string.IsNullOrEmpty(o.Excludelist) && File.Exists(o.Excludelist))
                {
                    partitions = new List <string>(File.ReadAllLines(o.Excludelist)).ToArray();
                }

                ulong eMMCDumpSize;
                ulong SectorSize = 0x200;

                if (o.ImgFile.ToLower().Contains(@"\\.\physicaldrive"))
                {
                    Logging.Log("Tool is running in Device Dump mode.");
                    Logging.Log("Gathering disk geometry...");
                    eMMCDumpSize = (ulong)GetDiskSize.GetDiskLength(@"\\.\PhysicalDrive" + o.ImgFile.ToLower().Replace(@"\\.\physicaldrive", ""));
                    SectorSize   = (ulong)GetDiskSize.GetDiskSectorSize(@"\\.\PhysicalDrive" + o.ImgFile.ToLower().Replace(@"\\.\physicaldrive", ""));
                }
                else
                {
                    Logging.Log("Tool is running in Image Dump mode.");
                    Logging.Log("Gathering disk image geometry...");
                    eMMCDumpSize = (ulong)new FileInfo(o.ImgFile).Length;
                }

                Logging.Log("Reported source device eMMC size is: " + eMMCDumpSize + " bytes - " + eMMCDumpSize / 1024 / 1024 + "MB - " + eMMCDumpSize / 1024 / 1024 / 1024 + "GB.");
                Logging.Log("Selected " + SectorSize + "B for the sector size");

                ConvertDD2VHD(o.ImgFile, o.VhdFile, partitions, o.Recovery, (int)SectorSize);
            });
        }
Пример #7
0
        public void DefaultSymbolSeveralYears()
        {
            var copyright = new CopyrightInfo("CommandLine, Ltd", 1999, 2003, 2004, 2007);

            Assert.AreEqual("Copyright (C) 1999 - 2003, 2004 - 2007 CommandLine, Ltd", copyright.ToString());
        }
Пример #8
0
        public void Default_symbol_several_years()
        {
            var copyright = new CopyrightInfo("CommandLine, Ltd", 1999, 2003, 2004, 2007);

            copyright.ToString().Should().Be("Copyright (C) 1999 - 2003, 2004 - 2007 CommandLine, Ltd");
        }
Пример #9
0
        public void UpperSymbolTwoConsecutiveYears()
        {
            var copyright = new CopyrightInfo(true, "X & Y Group", 2006, 2007);

            Assert.AreEqual("Copyright (C) 2006, 2007 X & Y Group", copyright.ToString());
        }
Пример #10
0
        public void DefaultSymbolTwoNonConsecutiveYears()
        {
            var copyright = new CopyrightInfo("W & Z, Inc.", 2005, 2007);

            Assert.AreEqual("Copyright (C) 2005 - 2007 W & Z, Inc.", copyright.ToString());
        }
Пример #11
0
        public void Upper_symbol_two_consecutive_years()
        {
            var copyright = new CopyrightInfo(true, "X & Y Group", 2006, 2007);

            copyright.ToString().Should().Be("Copyright (C) 2006, 2007 X & Y Group");
        }
Пример #12
0
        public void LowerSymbolOneYear()
        {
            var copyright = new CopyrightInfo(false, "Authors, Inc.", 2007);

            Assert.AreEqual("Copyright (c) 2007 Authors, Inc.", copyright.ToString());
        }
Пример #13
0
        public void Lower_symbol_one_year()
        {
            var copyright = new CopyrightInfo(false, "Authors, Inc.", 2007);

            copyright.ToString().Should().Be("Copyright (c) 2007 Authors, Inc.");
        }
        public void Lower_symbol_one_year()
        {
            var copyright = new CopyrightInfo(false, "Authors, Inc.", 2007);

            copyright.ToString().Should().Be("Copyright (c) 2007 Authors, Inc.");
        }
        public void Upper_symbol_two_consecutive_years()
        {
            var copyright = new CopyrightInfo(true, "X & Y Group", 2006, 2007);

            copyright.ToString().Should().Be("Copyright (C) 2006, 2007 X & Y Group");
        }
Пример #16
0
        public void Default_symbol_two_non_consecutive_years()
        {
            var copyright = new CopyrightInfo("W & Z, Inc.", 2005, 2007);

            copyright.ToString().Should().Be("Copyright (C) 2005 - 2007 W & Z, Inc.");
        }
Пример #17
0
        public void DefaultSymbolSeveralYears()
        {
            var copyright = new CopyrightInfo("CommandLine, Ltd", 1999, 2003, 2004, 2007);

            Assert.AreEqual("Copyright (C) 1999 - 2003, 2004 - 2007 CommandLine, Ltd", copyright.ToString());
        }
        public void Default_symbol_two_non_consecutive_years()
        {
            var copyright = new CopyrightInfo("W & Z, Inc.", 2005, 2007);

            copyright.ToString().Should().Be("Copyright (C) 2005 - 2007 W & Z, Inc.");
        }
Пример #19
0
        public void UpperSymbolTwoConsecutiveYears()
        {
            var copyright = new CopyrightInfo(true, "X & Y Group", 2006, 2007);

            copyright.ToString().Should().Equal("Copyright (C) 2006, 2007 X & Y Group");
        }
Пример #20
0
        public void DefaultSymbolTwoNonConsecutiveYears()
        {
            var copyright = new CopyrightInfo("W & Z, Inc.", 2005, 2007);

            copyright.ToString().Should().Equal("Copyright (C) 2005 - 2007 W & Z, Inc.");
        }
Пример #21
0
        public void LowerSymbolOneYear()
        {
            var copyright = new CopyrightInfo(false, "Authors, Inc.", 2007);

            copyright.ToString().Should().Equal("Copyright (c) 2007 Authors, Inc.");
        }
Пример #22
0
        public void DefaultSymbolTwoNonConsecutiveYears()
        {
            var copyright = new CopyrightInfo("W & Z, Inc.", 2005, 2007);

            Assert.AreEqual("Copyright (C) 2005 - 2007 W & Z, Inc.", copyright.ToString());
        }
        public void Default_symbol_several_years()
        {
            var copyright = new CopyrightInfo("CommandLine, Ltd", 1999, 2003, 2004, 2007);

            copyright.ToString().Should().Be("Copyright (C) 1999 - 2003, 2004 - 2007 CommandLine, Ltd");
        }