Author Topic: BDD & nwScript  (Read 873 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
BDD & nwScript
« on: November 26, 2013, 04:19:03 pm »


               For those who dont know.

BDD is Behavioural Driven Development (Some people use Business instead)


I've recently started learning how to do this in C# - primarilly for testing.

An example of this would be where I write code that Enters text into a text box in a web application (if I am doing automation)


I could then bind that method to a common english phrase.



[When("I type '(.*)' into the '(.*)' text box")]
public void TypeIntoTextBox(string p1, string p2)
{
//Implimentation here
}

 

In a BDD Environment - it could then interpret the phrase

When I type 'Hello World' into the 'Fun' text box

And know to type 'Hello World' into a text box with the label of 'Fun'


I use this type of framework with Selenium in C# (Specflow)

Im just curious if anyone has ever tried creating such a plugin/interface for nwscript.

eg:
Given a 'Player' has entered my trigger
Then a Damage Effect of type 'Fire' and Amount '400' will be applied to 'Player'
And I will speak text 'Hahahaha' on channel 'Shout'

It sounds interesting in theory, but no idea if its implimentable.