コード例 #1
0
        public void NormalComputer()
        {
            var computer = new Computer
            {
                AmountOfCores = 1,
                AmountOfRam   = 2,
                CpuFrequency  = 2.0m,
                DriveType     = "hdd"
            };

            var store   = new KitkartComputerStore();
            var builder = new NormalComputerBuilder();

            var normalComputer = store.Build(builder);

            Assert.AreEqual(normalComputer.AmountOfCores, computer.AmountOfCores);
            Assert.AreEqual(normalComputer.AmountOfRam, computer.AmountOfRam);
            Assert.AreEqual(normalComputer.CpuFrequency, computer.CpuFrequency);
            Assert.AreEqual(normalComputer.DriveType, computer.DriveType);
        }
コード例 #2
0
        public void SuperComputer()
        {
            var computer = new Computer
            {
                AmountOfCores = 64,
                AmountOfRam   = 256,
                CpuFrequency  = 3.4m,
                DriveType     = "ssd"
            };

            var store   = new KitkartComputerStore();
            var builder = new SuperComputerBuilder();

            var superComputer = store.Build(builder);

            Assert.AreEqual(superComputer.AmountOfCores, computer.AmountOfCores);
            Assert.AreEqual(superComputer.AmountOfRam, computer.AmountOfRam);
            Assert.AreEqual(superComputer.CpuFrequency, computer.CpuFrequency);
            Assert.AreEqual(superComputer.DriveType, computer.DriveType);
        }