This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Book book = new Book("Code Complete"); | |
XDocument document = book; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Book | |
{ | |
private readonly string title; | |
public Book(string title) | |
{ | |
this.title = title; | |
} | |
public static implicit operator XDocument(Book b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XDocument document = new XDocument(); | |
Book book = (Book)document; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static explicit operator Book(XDocument d) | |
{ | |
// Code to convert the XML document into a book | |
return new Book(""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loginInput = driver.FindElement(By.Id("txtUsername")); | |
loginInput.SendKeys("Joe"); | |
var passwordInput = driver.FindElement(By.Id("txtPassword")); | |
passwordInput.SendKeys("$ecret"); | |
var loginButton = driver.FindElement(By.Id("btnLogin")); | |
loginButton.Click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoginPage.GoTo(); | |
LoginPage.LoginAs("Joe").WithPassword("$ecret").Login(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add(int a, int b) | |
Add(decimal a, decimal b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator | |
{ | |
private readonly IStorageService storageService; | |
private List<int> history = new List<int>(); | |
private int sessionNumber = 1; | |
private bool newSession; | |
public Calculator(IStorageService storageService) | |
{ | |
this.storageService = storageService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator_Mockless | |
{ | |
private readonly StorageService storageService; | |
private readonly BasicCalculator basicCalculator; | |
public Calculator_Mockless() | |
{ | |
this.storageService = new StorageService(); | |
this.basicCalculator = new BasicCalculator(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var total = 0; | |
for(int i = n; i <= m; i++) | |
{ | |
total += f(i) | |
} |