Skip to content

Commit 16f09ff

Browse files
committed
FxCop and StyleCop fixes. No functional changes.
1 parent 3a99cb3 commit 16f09ff

File tree

3 files changed

+39
-33
lines changed

3 files changed

+39
-33
lines changed

Diff for: dotnet/src/support/GlobalSuppressions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
[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.")]
3131
[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.")]
3232
[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.")]
33+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "OpenQA.Selenium.Support.Extensions", Justification = "This namespace will likely grow over time.")]
3334
[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.")]
3435
[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.")]
3536
[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.")]

Diff for: dotnet/src/support/PageObjects/WebElementListProxy.cs

+25-25
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ internal class WebElementListProxy : IList<IWebElement>
3434
private readonly bool cache;
3535
private List<IWebElement> collection = null;
3636

37-
/// <summary>
38-
/// Prevents a default instance of the <see cref="WebElementListProxy"/> class.
39-
/// </summary>
40-
private WebElementListProxy()
41-
{
42-
}
43-
4437
/// <summary>
4538
/// Initializes a new instance of the <see cref="WebElementListProxy"/> class.
4639
/// </summary>
@@ -54,6 +47,13 @@ internal WebElementListProxy(ISearchContext searchContext, IEnumerable<By> bys,
5447
this.cache = cache;
5548
}
5649

50+
/// <summary>
51+
/// Prevents a default instance of the <see cref="WebElementListProxy"/> class from being created.
52+
/// </summary>
53+
private WebElementListProxy()
54+
{
55+
}
56+
5757
/// <summary>
5858
/// Gets the number of elements contained in the <see cref="WebElementListProxy"/> instance.
5959
/// </summary>
@@ -70,24 +70,6 @@ public bool IsReadOnly
7070
get { return true; }
7171
}
7272

73-
/// <summary>
74-
/// Gets or sets the element at the specified index.
75-
/// </summary>
76-
/// <param name="index">The zero-based index of the element to get or set.</param>
77-
/// <returns>The <see cref="IWebElement"/> at the specified index.</returns>
78-
public IWebElement this[int index]
79-
{
80-
get
81-
{
82-
return this.ElementList[index];
83-
}
84-
85-
set
86-
{
87-
throw new NotImplementedException();
88-
}
89-
}
90-
9173
private List<IWebElement> ElementList
9274
{
9375
get
@@ -106,6 +88,24 @@ private List<IWebElement> ElementList
10688
}
10789
}
10890

91+
/// <summary>
92+
/// Gets or sets the element at the specified index.
93+
/// </summary>
94+
/// <param name="index">The zero-based index of the element to get or set.</param>
95+
/// <returns>The <see cref="IWebElement"/> at the specified index.</returns>
96+
public IWebElement this[int index]
97+
{
98+
get
99+
{
100+
return this.ElementList[index];
101+
}
102+
103+
set
104+
{
105+
throw new NotImplementedException();
106+
}
107+
}
108+
109109
/// <summary>
110110
/// Determines whether an element is in the <see cref="WebElementListProxy"/>.
111111
/// </summary>

Diff for: dotnet/src/support/PageObjects/WebElementProxy.cs

+13-8
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ internal class WebElementProxy : IWebElement, ILocatable, IWrapsElement
3636
private readonly bool cache;
3737
private IWebElement cachedElement;
3838

39-
/// <summary>
40-
/// Prevents a default instance of the <see cref="WebElementProxy"/> class.
41-
/// </summary>
42-
private WebElementProxy()
43-
{
44-
}
45-
4639
/// <summary>
4740
/// Initializes a new instance of the <see cref="WebElementProxy"/> class.
4841
/// </summary>
@@ -56,6 +49,13 @@ internal WebElementProxy(ISearchContext searchContext, IEnumerable<By> bys, bool
5649
this.cache = cache;
5750
}
5851

52+
/// <summary>
53+
/// Prevents a default instance of the <see cref="WebElementProxy"/> class from being created.
54+
/// </summary>
55+
private WebElementProxy()
56+
{
57+
}
58+
5959
/// <summary>
6060
/// Gets the tag name of this element.
6161
/// </summary>
@@ -141,7 +141,7 @@ public ICoordinates Coordinates
141141
}
142142

143143
/// <summary>
144-
/// Defines the interface through which the user can discover if there is an underlying element to be used.
144+
/// Gets the interface through which the user can discover if there is an underlying element to be used.
145145
/// </summary>
146146
public IWebElement WrappedElement
147147
{
@@ -181,6 +181,7 @@ public void Clear()
181181
/// <summary>
182182
/// Simulates typing text into the element.
183183
/// </summary>
184+
/// <param name="text">The keys to send to the element.</param>
184185
public void SendKeys(string text)
185186
{
186187
this.WrappedElement.SendKeys(text);
@@ -205,6 +206,8 @@ public void Click()
205206
/// <summary>
206207
/// Gets the value of the specified attribute for this element.
207208
/// </summary>
209+
/// <param name="attributeName">The attribute name to retrieve the value of.</param>
210+
/// <returns>The value of the attribute. Returns <see langword="null"/> if the attribute does not exist.</returns>
208211
public string GetAttribute(string attributeName)
209212
{
210213
return this.WrappedElement.GetAttribute(attributeName);
@@ -213,6 +216,8 @@ public string GetAttribute(string attributeName)
213216
/// <summary>
214217
/// Gets the value of a CSS property of this element.
215218
/// </summary>
219+
/// <param name="propertyName">The property name to retrieve the value of.</param>
220+
/// <returns>The value of the CSS property.</returns>
216221
public string GetCssValue(string propertyName)
217222
{
218223
return this.WrappedElement.GetCssValue(propertyName);

0 commit comments

Comments
 (0)