Skip to content

Commit

Permalink
FxCop and StyleCop fixes. No functional changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Dec 13, 2013
1 parent 3a99cb3 commit 16f09ff
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 33 deletions.
1 change: 1 addition & 0 deletions dotnet/src/support/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "1#", Scope = "member", Target = "OpenQA.Selenium.Support.Events.WebDriverNavigationEventArgs.#.ctor(OpenQA.Selenium.IWebDriver,System.String)", Justification = "Using string to preserve user input.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Scope = "member", Target = "OpenQA.Selenium.Support.Events.WebDriverNavigationEventArgs.#Url", Justification = "Using string to preserve user input.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "OpenQA.Selenium.Support.Events.EventFiringWebDriver+EventFiringWebElement.#ParentDriver", Justification = "Method must be available for subclasses.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "OpenQA.Selenium.Support.Extensions", Justification = "This namespace will likely grow over time.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "OpenQA.Selenium.Support.Events.EventFiringWebDriver.#Close()", Justification = "Firing event on all execptions, so catching generic Exception is appropriate.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "OpenQA.Selenium.Support.Events.EventFiringWebDriver.#CurrentWindowHandle", Justification = "Firing event on all execptions, so catching generic Exception is appropriate.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "OpenQA.Selenium.Support.Events.EventFiringWebDriver.#ExecuteAsyncScript(System.String,System.Object[])", Justification = "Firing event on all execptions, so catching generic Exception is appropriate.")]
Expand Down
50 changes: 25 additions & 25 deletions dotnet/src/support/PageObjects/WebElementListProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ internal class WebElementListProxy : IList<IWebElement>
private readonly bool cache;
private List<IWebElement> collection = null;

/// <summary>
/// Prevents a default instance of the <see cref="WebElementListProxy"/> class.
/// </summary>
private WebElementListProxy()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="WebElementListProxy"/> class.
/// </summary>
Expand All @@ -54,6 +47,13 @@ internal WebElementListProxy(ISearchContext searchContext, IEnumerable<By> bys,
this.cache = cache;
}

/// <summary>
/// Prevents a default instance of the <see cref="WebElementListProxy"/> class from being created.
/// </summary>
private WebElementListProxy()
{
}

/// <summary>
/// Gets the number of elements contained in the <see cref="WebElementListProxy"/> instance.
/// </summary>
Expand All @@ -70,24 +70,6 @@ public bool IsReadOnly
get { return true; }
}

/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the element to get or set.</param>
/// <returns>The <see cref="IWebElement"/> at the specified index.</returns>
public IWebElement this[int index]
{
get
{
return this.ElementList[index];
}

set
{
throw new NotImplementedException();
}
}

private List<IWebElement> ElementList
{
get
Expand All @@ -106,6 +88,24 @@ private List<IWebElement> ElementList
}
}

/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the element to get or set.</param>
/// <returns>The <see cref="IWebElement"/> at the specified index.</returns>
public IWebElement this[int index]
{
get
{
return this.ElementList[index];
}

set
{
throw new NotImplementedException();
}
}

/// <summary>
/// Determines whether an element is in the <see cref="WebElementListProxy"/>.
/// </summary>
Expand Down
21 changes: 13 additions & 8 deletions dotnet/src/support/PageObjects/WebElementProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ internal class WebElementProxy : IWebElement, ILocatable, IWrapsElement
private readonly bool cache;
private IWebElement cachedElement;

/// <summary>
/// Prevents a default instance of the <see cref="WebElementProxy"/> class.
/// </summary>
private WebElementProxy()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="WebElementProxy"/> class.
/// </summary>
Expand All @@ -56,6 +49,13 @@ internal WebElementProxy(ISearchContext searchContext, IEnumerable<By> bys, bool
this.cache = cache;
}

/// <summary>
/// Prevents a default instance of the <see cref="WebElementProxy"/> class from being created.
/// </summary>
private WebElementProxy()
{
}

/// <summary>
/// Gets the tag name of this element.
/// </summary>
Expand Down Expand Up @@ -141,7 +141,7 @@ public ICoordinates Coordinates
}

/// <summary>
/// Defines the interface through which the user can discover if there is an underlying element to be used.
/// Gets the interface through which the user can discover if there is an underlying element to be used.
/// </summary>
public IWebElement WrappedElement
{
Expand Down Expand Up @@ -181,6 +181,7 @@ public void Clear()
/// <summary>
/// Simulates typing text into the element.
/// </summary>
/// <param name="text">The keys to send to the element.</param>
public void SendKeys(string text)
{
this.WrappedElement.SendKeys(text);
Expand All @@ -205,6 +206,8 @@ public void Click()
/// <summary>
/// Gets the value of the specified attribute for this element.
/// </summary>
/// <param name="attributeName">The attribute name to retrieve the value of.</param>
/// <returns>The value of the attribute. Returns <see langword="null"/> if the attribute does not exist.</returns>
public string GetAttribute(string attributeName)
{
return this.WrappedElement.GetAttribute(attributeName);
Expand All @@ -213,6 +216,8 @@ public string GetAttribute(string attributeName)
/// <summary>
/// Gets the value of a CSS property of this element.
/// </summary>
/// <param name="propertyName">The property name to retrieve the value of.</param>
/// <returns>The value of the CSS property.</returns>
public string GetCssValue(string propertyName)
{
return this.WrappedElement.GetCssValue(propertyName);
Expand Down

0 comments on commit 16f09ff

Please sign in to comment.