Пример #1
0
        public void Should_Save_Xml_File_For_The_Tank()
        {
            var actual = _sut.Save();
            var path   = _fileHelper.ToApplicationPath("TestTank.xml");

            Assert.AreEqual($"TestTank.xml file created in the {path} folder.", actual);
        }
Пример #2
0
        public void Run()
        {
            //tank null kontrol
            if (_tank != null)
            {
                var goldFish = new GoldFish("Gold");
                _tank.AddFish(goldFish);

                var angelFish = new AngelFish("Angel");
                _tank.AddFish(angelFish);


                var babelFish = new BabelFish("Babel");
                _tank.AddFish(babelFish);

                var goldFishNemo = new GoldFish("Nemo");
                _tank.AddFish(goldFishNemo);

                var tankFile = _xmlSaver.Save();

                if (!string.IsNullOrEmpty(tankFile))
                {
                    Console.WriteLine(tankFile + Environment.NewLine);
                }

                foreach (var item in _tank.GetFishList())
                {
                    Console.WriteLine($"Fishes in the Tank: {item.Name}");
                }
            }
            else
            {
                Console.WriteLine("Tank is not found!");
            }
        }