public void BottomLinkChecking(int row, int countRow, int link3, int link4)
        {
            var light = new LightsInModel(new Point(0, 0), true, 5);

            light.DefinitionLinks(9, 5, row, countRow);

            Assert.AreEqual(link3, light.Links[3]);
            Assert.AreEqual(link4, light.Links[4]);
        }
        public void MidleLinkChecking(int numberLight, int link2, int link5)
        {
            var light = new LightsInModel(new Point(0, 0), true, 5);

            light.DefinitionLinks(numberLight, 3, 0, 5);

            Assert.AreEqual(link2, light.Links[2]);
            Assert.AreEqual(link5, light.Links[5]);
        }
        public void TopLinkChecking(int row, int countRow, int link0, int link1)
        {
            var light = new LightsInModel(new Point(0, 0), true, 5);

            light.DefinitionLinks(9, 5, row, countRow);

            Assert.AreEqual(link0, light.Links[0]);
            Assert.AreEqual(link1, light.Links[1]);
        }
        public void NegativeTestCreate(int numberLight, int countInRow, int row, int countRow)
        {
            var light = new LightsInModel(new Point(0, 0), true, 5);

            light.DefinitionLinks(numberLight, countInRow, row, countInRow);

            Assert.That(light.Links, Is.All.Not.Null);
            Assert.That(light.Links, Is.Not.Unique);
        }
        public void PositiveTestCreate(int numberLight, int countInRow, int row, int countRow)
        {
            var light = new LightsInModel(new Point(0, 0), true, 5);

            light.DefinitionLinks(numberLight, countInRow, row, countInRow);

            // Проверяем, что в массиве нет пустых элементов
            Assert.That(light.Links, Is.All.Not.Null);
            // Проверяем уникальность
            Assert.That(light.Links, Is.Unique);
        }
Beispiel #6
0
        public void CheckParamWires()
        {
            var param     = new ParamInModel(20, 20, 0);
            var light     = new LightsInModel(new Point(0, 0), true, 5);
            var direction = 0;

            light.AddWires(direction, param);

            Assert.AreEqual(light.Light.Coordinate, light.Wires[0].CoordinateStart);
            Assert.AreEqual(direction, light.Wires[0].Direction);
            Assert.AreEqual(param.Length, light.Wires[0].Length);
        }
Beispiel #7
0
        public void CreateTest(int countWires)
        {
            var param = new ParamInModel(20, 20, 0);
            var light = new LightsInModel(new Point(0, 0), true, 5);

            for (int i = 0; i < countWires; i++)
            {
                light.AddWires(0, param);
            }

            Assert.That(light.Wires, Is.All.Not.Null);
            Assert.That(light.Wires, Is.All.TypeOf(typeof(Wires)));
        }
        public void CreateTest()
        {
            Random rnd    = new Random();
            var    point  = new Point(rnd.Next(), rnd.Next());
            bool   state  = rnd.Next() % 2 == 0 ? true : false;
            int    radius = rnd.Next();

            var light = new LightsInModel(point, state, radius);

            Assert.AreEqual(point, light.Light.Coordinate);
            Assert.AreEqual(state, light.Light.StateOn);
            Assert.AreEqual(radius, light.Light.Radius);
            Assert.AreEqual(false, light.Involvement);
            Assert.AreEqual(6, light.Links.Length);
            Assert.That(light.Wires, Is.Empty);
        }