Пример #1
0
 public SellingTests()
 {
     builder = new StudentOfficeBuilder();
     sut     = builder.office;
     john    = builder.john; jane = builder.jane;
     sut.SellProduct(john, new Order(ProductGenerator.chips, 5));
     sut.SellProduct(jane, new Order(ProductGenerator.chips, 3));
 }
Пример #2
0
        public void AddingOtherClientTest()
        {
            // Testing adding a single client of type OtherClient to an empty student office
            StudentOffice instantTest = new StudentOffice();

            instantTest.AddClient(john, 0);
            Assert.Single(instantTest.ClientList);
        }
Пример #3
0
        public void MealPlanSellingTest()
        {
            sut.CompleteMeal(ProductGenerator.sandwich, ProductGenerator.chocolatebar, ProductGenerator.water);
            StudentOffice studentoffice = builder.office;

            studentoffice.SellMealPlan(preparator, john);

            Assert.Equal(44.5m, studentoffice.ClientList[john]);
        }
Пример #4
0
        public void TestOperatorEqual()
        {
            // Test of the == and != overrided operators for client

            StudentOffice office   = new StudentOffice();
            Client        sameJohn = office.CreateClient("DOE", "john", 30, 1985);

            Assert.True(john == sameJohn);
            Assert.True(john != jane);
        }
Пример #5
0
 internal StudentOfficeBuilder()
 {
     office          = new StudentOffice(new Stock(1000m, new OrderingRepository()));
     commercial      = office._commercial;
     stock           = office.Stock;
     products        = new ProductGenerator(commercial);
     mealPlanBuilder = new MealPlanDirector();
     InitializeStock();
     office.AddClient(john, 50); office.AddClient(jane, 50);
     stock.Attach(office);
 }
Пример #6
0
 public TransactionTests()
 {
     office = new StudentOffice(new StubStock());
     john   = Clients.John();
     office.AddClient(john, 15);
 }
Пример #7
0
 public StudentOfficeTests()
 {
     builder = new StudentOfficeBuilder();
     SUT     = builder.office;
     john    = Clients.John(); jane = Clients.Jane();
 }
Пример #8
0
 public MementoTests()
 {
     office = builder.office;
     builder.office.TransactionsList.Add(new Transaction(ProductGenerator.chips, 5, Clients.John()));
 }
Пример #9
0
 public CommercialTests()
 {
     builder = new StudentOfficeBuilder();
     office  = builder.office;
     water   = ProductGenerator.water; chips = ProductGenerator.chips; beer = ProductGenerator.beer;
 }