Bug Report B137219
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

CodeGen - Add options to specify code generation rules

Introduce Using removes empty line whitespace in code

created 16 years ago

When using "Introduce Using Statement" the whitespace (empty lines) in the code block are removed. (See attached screenshots)
Steps to Reproduce:
Select a code block with white space between lines of code and use "Introduce Using Statement" and the code will contract as the white space between lines of code is also removed.
For example:
        [TestCase]
        public static void IndexRedirectsToLandingPage()
        {
            // Arrange
            AdminController controller = new AdminController();
            // Act
            ActionResult result = controller.Index();
            // Assert
            Assert.NotNull(result, "Expected non-null result");
            RedirectToRouteResult routeResult = result as RedirectToRouteResult;
            Assert.NotNull(routeResult, "Expected the result ot be a RedirectToRouteResult");
            string controllerName = routeResult.RouteValues["Controller"] as string;
            string action = routeResult.RouteValues["Action"] as string;
            Assert.AreEqual("Admin", controllerName, "Expected the controller to be 'Admin'");
            Assert.AreEqual("Home", action, "Expected the 'Home' action");

}
Actual Results:
[TestCase]
        public static void IndexRedirectsToLandingPage()
        {
            // Arrange
            using (AdminController controller = new AdminController())
            {
                // Act
                ActionResult result = controller.Index();
                // Assert
                Assert.NotNull(result, "Expected non-null result");
                RedirectToRouteResult routeResult = result as RedirectToRouteResult;
                Assert.NotNull(routeResult, "Expected the result ot be a RedirectToRouteResult");
                string controllerName = routeResult.RouteValues["Controller"] as string;
                string action = routeResult.RouteValues["Action"] as string;
                Assert.AreEqual("Admin", controllerName, "Expected the controller to be 'Admin'");
                Assert.AreEqual("Home", action, "Expected the 'Home' action");
            }

}
Expected Results:
[TestCase]
        public static void IndexRedirectsToLandingPage()
        {
            // Arrange
            using (AdminController controller = new AdminController())
            {
                // Act
                ActionResult result = controller.Index();
                // Assert
                Assert.NotNull(result, "Expected non-null result");
                RedirectToRouteResult routeResult = result as RedirectToRouteResult;
                Assert.NotNull(routeResult, "Expected the result ot be a RedirectToRouteResult");
                string controllerName = routeResult.RouteValues["Controller"] as string;
                string action = routeResult.RouteValues["Action"] as string;
                Assert.AreEqual("Admin", controllerName, "Expected the controller to be 'Admin'");
                Assert.AreEqual("Home", action, "Expected the 'Home' action");
            }

}

Comments (1)
Serge (DevExpress Support) 16 years ago

    Hi Colin,
    Thank you for the report. This is a limitation of the current version of the refactoring. We have a suggestion to improve this functionality in the future. You can learn our progress over this item by tracking the following report:
      CodeGen - Add options to specify code generation rules
    Thanks,
    Serge

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.