Exemple #1
0
        public void HasDefaultColorAndSizeTest1()
        {
            // Arrange
            GridBorders borders = new GridBorders();
            // Act
            bool actualResult = borders.HasDefaultColorAndSize();

            // Assert
            Assert.IsTrue(actualResult);
        }
Exemple #2
0
        public void PropertyRightDefaultValue()
        {
            // Arrange
            GridBorders borders        = new GridBorders();
            string      expectedResult = "0";
            // Act
            string actualResult = borders.Properties["Right"];

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #3
0
        public void HasDefaultColorAndSizeTest2()
        {
            // Arrange
            GridBorders borders = new GridBorders();

            borders.Properties["Color"] = "Red";
            // Act
            bool actualResult = borders.HasDefaultColorAndSize();

            // Assert
            Assert.IsFalse(actualResult);
        }
Exemple #4
0
        public void ProcessBordersPropertyTestTop()
        {
            // Arrange
            GridBorders borders        = new GridBorders();
            string      expectedResult = "5";

            // Act
            GridBordersPropertyReader.ProcessBordersProperty(borders, "Top", "5");
            string actualResult = borders.Properties["Top"];

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #5
0
        public void ProcessBordersPropertyTestBorderType()
        {
            // Arrange
            GridBorders borders        = new GridBorders();
            string      expectedResult = "Groove";

            // Act
            GridBordersPropertyReader.ProcessBordersProperty(borders, "BorderType", "C1.Win.C1TrueDBGrid.BorderTypeEnum.Groove");
            string actualResult = borders.Properties["BorderType"];

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #6
0
        public void ProcessBordersPropertyTestColor()
        {
            // Arrange
            GridBorders borders        = new GridBorders();
            string      expectedResult = "Blue";

            // Act
            GridBordersPropertyReader.ProcessBordersProperty(borders, "Color", "System.Drawing.Color.Blue");
            string actualResult = borders.Properties["Color"];

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #7
0
        public void UpdatePropertiesAccordingToTypeFlat()
        {
            // Arrange
            GridBorders borders = new GridBorders();

            borders.Properties["BorderType"] = "Flat";
            // Act
            borders.UpdatePropertiesAccordingToType();
            bool actualResult = borders.Properties["Color"] == "ControlDark";

            // Assert
            Assert.IsTrue(actualResult);
        }
Exemple #8
0
        public void ParseValueStringTest()
        {
            // Act
            GridBorders borders      = GridBorders.ParseValueString("Inset,223,221,220, 3,2,1,0");
            bool        actualResult = borders.Properties["BorderType"] == "Inset" &&
                                       borders.Properties["Color"] == "223,221,220" &&
                                       borders.Properties["Left"] == "3" &&
                                       borders.Properties["Right"] == "2" &&
                                       borders.Properties["Top"] == "1" &&
                                       borders.Properties["Bottom"] == "0";

            // Assert
            Assert.IsTrue(actualResult);
        }
Exemple #9
0
        public void UpdatePropertiesAccordingToTypeFillet()
        {
            // Arrange
            GridBorders borders = new GridBorders();

            borders.Properties["BorderType"] = "Fillet";
            // Act
            borders.UpdatePropertiesAccordingToType();
            bool actualResult = borders.Properties["Left"] == "2" &&
                                borders.Properties["Right"] == "2" &&
                                borders.Properties["Top"] == "2" &&
                                borders.Properties["Bottom"] == "2";

            // Assert
            Assert.IsTrue(actualResult);
        }
Exemple #10
0
        public void ValueToStyleStringTest()
        {
            // Arrange
            GridBorders borders        = new GridBorders();
            string      expectedResult = "Fillet,Yellow,0,2,1,4";

            borders.Properties["BorderType"] = "Fillet";
            borders.Properties["Color"]      = "Yellow";
            borders.Properties["Left"]       = "0";
            borders.Properties["Right"]      = "2";
            borders.Properties["Top"]        = "1";
            borders.Properties["Bottom"]     = "4";
            // Act
            string actualResult = borders.ValueToStyleString();

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }