Skip to content

Instantly share code, notes, and snippets.

View costea32's full-sized avatar

Constantin Pascal costea32

View GitHub Profile
@costea32
costea32 / BasicWrappers.cs
Last active August 29, 2015 14:05
Selenium WebElement Basic Wrappers
public class HtmlControl
{
protected readonly IWebElement webElement;
public HtmlControl(IWebElement webElement)
{
this.webElement = webElement;
}
public void Click()
@costea32
costea32 / gist:2fa1677832483c14c03b
Last active August 29, 2015 14:05
AssertionExtension - CummulativeAssert example
[TestMethod]
public void CumulativeAssert_MultipleFailuresExample()
{
//Some actions
CumulativeAssert.That(false,"Boolean failure");
//Some actions
CumulativeAssert.That(true, "Boolean passed");
//More actions
CumulativeAssert.That(1, Is.EqualTo(2), "int equality");
//Some actions
@costea32
costea32 / gist:f493aa13eb9f66ab7185
Last active August 29, 2015 14:05
AssertionExtension - PropertySetTestExample
[TestMethod]
public void BlogExample_PropertySet()
{
var expected = new BlogExampleObject
{
ChildObject = new TestObject{Value="ChildObjectValue1"},
ChildObjectList = new List<TestObject>{new TestObject{Value="ListObject1"}},
IgnoredProperty = "1",
ProcessedProperty = "Test"
};
@costea32
costea32 / gist:615fea91e921a1157985
Last active August 29, 2015 14:05
AssertionExtensions - PropertySetExample
public class BlogExampleObject
{
//Will always check that actual value is greater
// than attribute argument
//And will ignore comparison if expected is 0
[ValidateActualGreaterThan(0)]
public int Id { get; set; }
//Will always check that actual value is not null
//And will ignore comparison if expected is null