Inheritance: ITestCustomer
示例#1
0
        public void ShouldLoginAsANewUserD()
        {
            var customer = new TestCustomer("*****@*****.**");

            SoThat(MyBusinessValue.WeIncreaseTheCustomerBase)
                .As(new WebUser())
                .GivenWe(x => FullyRegister(x, customer)) //delegate call to do a set of actions
                .When(customer.Has("confirmed").Registration)
                .Then(customer.Login);
        }
示例#2
0
        public void IWantToRegisterANewUserA()
        {
            //Demonstrates basic usage
            var customer = new TestCustomer("*****@*****.**");

            SoThat(MyBusinessValue.WeIncreaseTheCustomerBase)
                .As(new WebUser())
                .Given(customer.Has("completed").Registration)
                .When(customer.Has("confirmed").Registration)
                .Then(customer.Login);
        }
示例#3
0
        public void IWantToRegisterANewUserC()
        {
            //Demonstrates inline naming and renaming through test
            var user = new WebUser();
            var newCustomer = new TestCustomer("*****@*****.**");

            SoThat(MyBusinessValue.WeIncreaseTheCustomerBase)
                .As(user.Named("The user"))
                .Given(newCustomer.Named("customer for the first time").Has("completed").Registration)
                .When(newCustomer.Named("via email customer").Has("confirmed").Registration)
                .Then(newCustomer.Named("returning customer").Login);
        }
示例#4
0
        public void IWantToRegisterANewUserB()
        {
            //Demonstrates more descriptive naming of personas and entities
            var user = new WebUser().Named("a web user"); //naming by hand
            var newCustomer = new TestCustomer("*****@*****.**");
            newCustomer.Named(() => newCustomer); //naming from variable name

            SoThat(MyBusinessValue.WeIncreaseTheCustomerBase)
                .As(user)
                .Given(newCustomer.Has("completed").Registration)
                .When(newCustomer.Has("confirmed").Registration)
                .Then(newCustomer.Login);
        }