using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Core;
using Core.OrderStates;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TechTalk.SpecFlow;
namespace AcceptanceTests.StepDefinitions
{
[Binding]
public class StepDefinitions
{
private Customer customer;
private Order order;
private Product product;
private bool orderOk;
[Given(@"I have a customer with an order for socks")]
public void GivenIHaveACustomerWithAnOrderForSocks()
{
customer = new Customer(){FirstName = "chris", LastName = "mckelt"};
product = new SockProduct() {Id = 1, Name = "AAA", Price = 30};
order = new Order(customer);
order.AddProduct(product);
}
[Given(@"the order is to be sent to Australia")]
public void GivenTheOrderIsToBeSentToAustralia()
{
order.SetShippingDestination(ShippingDestination.Australia);
}
[Then(@"I should not be able to place the order")]
public void ThenIShouldNotBeAbleToPlaceTheOrder()
{
Assert.IsFalse(orderOk);
}
[When(@"I process the order")]
public void WhenIProcessTheOrder()
{
orderOk = order.CanBecome(new OrderConfirmed());
}
}
}