Syntax is fine, code runs fine, aside from making it look nicer, what is the point of having curly braces inside of a function?
public void Foo()
{
string txt = "hello world";
{ <---- THIS
Assert.AreEqual("hello world", txt);
} <---- THIS
}
EXAMPLE: The code was generated using selenium IDE
// Generated by Selenium IDE
[Test]
public void fsdafdsafds() {
driver.Navigate().GoToUrl("https://www.seleniumeasy.com/test/basic-select-dropdown-demo.html");
driver.Manage().Window.Size = new System.Drawing.Size(1696, 1026);
driver.FindElement(By.Id("select-demo")).Click();
{
var dropdown = driver.FindElement(By.Id("select-demo"));
dropdown.FindElement(By.XPath("//option[. = 'Sunday']")).Click();
}
driver.FindElement(By.Id("select-demo")).Click();
{
var dropdown = driver.FindElement(By.Id("multi-select"));
dropdown.FindElement(By.XPath("//option[. = 'California']")).Click();
}
{
var dropdown = driver.FindElement(By.Id("multi-select"));
dropdown.FindElement(By.XPath("//option[. = 'New Jersey']")).Click();
}
driver.FindElement(By.Id("printMe")).Click();
driver.FindElement(By.Id("printAll")).Click();
}