Hi all, this post will only contain the useful links which I will gather throughout from my R&D and learning :
- http://www.hongkiat.com/blog/ios-development-guide-part1/
WCF Service | Web Service |
---|---|
-> Communication can happen over HTTP,TCP, IPC or even MSMQ. -> It can be configured to have simplex,request-response or even full duplex communication. -> Can be hosted inside web server or event self hosted. | -> Communication can happen over HTTP only. -> Only simplex and request-response communication is possible. -> Work in stateless fashion over HTTP and hosted inside a web server. |
Feature: SpecFlowFeature1 In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers @mytag Scenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into the calculator When I press add Then the result should be 120 on the screen
Where "@mytag" is used for scope i.e. in step definition file we can specify the scope of definition by declaring [Scope(Tag = "mytag")] on top of the class.
By default the color of Given,when and then statements will be pink and that means there is not binding yet for these steps as shown in figure below :
[Scope(Tag = "mytag")] [Binding] public class FirstSecenrio {
Now you are ready to run your tests , open re sharper test window and start running your tests.
To work with coypu , you must configure your browser settings in BeforeTestRun method of your binding class and start accessing your webpage controls, see https://github.com/featurist/coypu-jvm page for this.
Your binding class after coypu browser settings will look like this :
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Coypu; using Coypu.Drivers; using Coypu.Drivers.Selenium; using NUnit.Framework; using TechTalk.SpecFlow; namespace SpecflowCypu.Tests.StepsDefinitions { [Scope(Tag = "mytag")] [Binding] public class FirstSecenrio { private static BrowserSession browser; [Test] [BeforeTestRun] public static void BeforeTestRun() { SessionConfiguration sessionConfiguration = new SessionConfiguration(); sessionConfiguration.AppHost = "localhost"; sessionConfiguration.Port = 5555; sessionConfiguration.SSL = false; sessionConfiguration.Browser = Browser.Firefox; browser = new BrowserSession(); } [Test] [AfterScenario] public static void AfterScenario() { } [Test] [Given(@"I have entered 50 into the calculator")] public void GivenIHaveEntered50IntoTheCalculator() { browser.Visit("https://gmail.com"); // ScenarioContext.Current.Pending(); } [Test] [Given(@"I have entered 70 into the calculator")] public void GivenIHaveEntered70IntoTheCalculator() { //ScenarioContext.Current.Pending(); } [Test] [When(@"I press add")] public void WhenIPressAdd() { //ScenarioContext.Current.Pending(); } [Test] [Then(@"the result should be 120 on the screen")] public void ThenTheResultShouldBe120OnTheScreen() { //ScenarioContext.Current.Pending(); } } }That was very short and to the point tutorial on BDD using specflow , will explain more very soon.
public class Movie { // Default ctor public Movie() { } [XmlAttribute(AttributeName="MovieTitle")] // stores element in xml file with this name public string Title { get; set; } public string Director { get; set; } [XmlElement(ElementName ="ReleaseDate")] public DateTime Year { get; set; } public double Budget { get; set; } }
private static void SerializeMovieXML(List<Movie> movies) { // Step 1 XmlSerializer serializer = new XmlSerializer(typeof (List<Movie>)); // Step 2 TextWriter txtWriter = new StreamWriter(@"D:\Movies.xml"); // Step 3 serializer.Serialize(txtWriter, movies); // step 4 txtWriter.Close(); }
This function store Movies.xml file in D drive , you can change this location.
Third step is to create object of movie class and use above method to create xml.
Movie m = new Movie(); m.Title = "BOL"; m.Director = "Shoiab Mansoor"; m.Year = new DateTime(2011, 09, 05); m.Budget = 10000000; Movie m1 = new Movie(); m1.Title = "Forrest Gump"; m1.Director = "I Dont Know"; m1.Year = new DateTime(1990, 09, 05); m1.Budget = 50000000; List<Movie> movie = new List<Movie>(); movie.Add(m); movie.Add(m1); SerializeMovieXML(movie);
<?xml version="1.0" encoding="utf-8"?> <ArrayOfMovie xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Movie MovieTitle="BOL"> <Director>Shoiab Mansoor</Director> <ReleaseDate>2011-09-05T00:00:00</ReleaseDate> <Budget>10000000</Budget> </Movie> <Movie MovieTitle="Forrest Gump"> <Director>I Dont Know</Director> <ReleaseDate>1990-09-05T00:00:00</ReleaseDate> <Budget>50000000</Budget> </Movie> </ArrayOfMovie>
Now if you want to de-serialize above xml into object , following method will be used :
private static List<Movie> DeserializeMovieXML() { // step 1 XmlSerializer serializer = new XmlSerializer(typeof (List<Movie>)); // step 2 TextReader txtReader = new StreamReader(@"D:\Movies.xml"); // step 3 List<Movie> m = serializer.Deserialize(txtReader) as List<Movie>; txtReader.Close(); return m; }and you can use this method in this way to get your object back :
List<Movie> movies = DeserializeMovieXML();
That's it, do code and enjoy :)
var el=Ext.getBody().el;
el.scrollBy(10, 10, true);
el.scrollBy([10, 10], true);
el.scrollBy({ x: 10, y: 10 }, true);
or you can use:
el.scrollTo( side, value, [animate] ) ; where side may be left or top , value is integer and true or false for animate or not.
And that's simply it :)