diff --git a/domain-model.md b/domain-model.md new file mode 100644 index 00000000..bcf3037e --- /dev/null +++ b/domain-model.md @@ -0,0 +1,115 @@ +# Domain Model +``` +1. +As a member of the public, +So I can order a bagel before work, +I'd like to add a specific type of bagel to my basket. +``` + +``` +2. +As a member of the public, +So I can change my order, +I'd like to remove a bagel from my basket. +``` + +``` +3. +As a member of the public, +So that I can not overfill my small bagel basket +I'd like to know when my basket is full when I try adding an item beyond my basket capacity. +``` + +``` +4. +As a Bob's Bagels manager, +So that I can expand my business, +I’d like to change the capacity of baskets. +``` + +``` +5. +As a member of the public +So that I can maintain my sanity +I'd like to know if I try to remove an item that doesn't exist in my basket. +``` + +``` +6. +As a customer, +So I know how much money I need, +I'd like to know the total cost of items in my basket. +``` + +``` +7. +As a customer, +So I know what the damage will be, +I'd like to know the cost of a bagel before I add it to my basket. +``` + +``` +8. +As a customer, +So I can shake things up a bit, +I'd like to be able to choose fillings for my bagel. +``` + +``` +9. +As a customer, +So I don't over-spend, +I'd like to know the cost of each filling before I add it to my bagel order. +``` + +``` +10. +As the manager, +So we don't get any weird requests, +I want customers to only be able to order things that we stock in our inventory. +``` +## Core +| Class | Method/Property | Scenario | Output | +|-------|-----------------|----------|--------| +| Basket | AddItem(IStoreItem item) | Add an Item to a Basket | void | +| Basket | RemoveItem(IStoreItem item) | Remove an Item to a Basket | void | +| Basket | IsFull() | Checks if basket is full | bool | +| Store | ChangeCap() | Changes capacity of baskets | void | +| Basket | BasketHas(IStoreItem item) | Checks if basket has item | bool | +| Basket | Remove(StoreItem item) | Removes item from basket if the basket has that item | void | +| Basket | TotalCost() | Returns total cost of Basket | int | +| Bagel | AddFillings(Filling filling) | Add filling to bagel | void | +| Bagel | GetTotalPrice() | Get total cost of bagel including fillings | Decimal | +| IStoreItem | Interface with methods for products | Interface for bagel, filling and coffee | | +| IStoreItem | Price | attribute that has the price of an IStoreItem | int | +| Store | GetInventory() | function that returns the inventory of the store | List | +| IStoreItem | Copy() | function to copy a storeItem, makes it easier to choose a bagel/coffee/filling from a menu | IStoreItem | +| IStoreItem | Equivalent(IstoreItem item) | Checks wheter an item is equivalent to the instance it's called on| bool | +| Inventory | SKU | Attribute that has the Sku of an Inventory instance | string | +| Inventory | Price | Attribute that has the Price of an Inventory instance | decimal | +| Inventory | Name | Attribute that has the Name of an Inventory instance | string | +| Inventory | Variant | Attribute that has the Variant of an Inventory instance | string | +| Store | MaxCapacity | Attribute that should be handed over when creatiing a basket at the store | int | +| Store | Name | Attribute that holds the name of the store | string | +| Store | InventoryList | List of all Items available | List | +| Store | StoreHasItem(IStoreItem item) | Method that checks if the Item exists in Inventory | bool | +| Basket | ClearBasket() | Removes all items from basket | void | +| Store | CreateBagel(string sku) | Creates a bagel from inventory | Bagel | +| Store | CreateCoffee(string sku) | Creates a coffee from inventory | Coffee | +| Store | CreateFilling(string sku) | Creates a filling from inventory | Filling | +| Store | CreateNewBasket() | Creates a new basket with max capacity from the store | Basket | +| Store | AddFillToBagel(Bagel bagel, Filling fill) | Adds a filling to a bagel | void | + +## Extension + +### Discounts +- I want to be able to get discounts when buying large amounts of bagels +- I want to have a breakfast deal with a coffee and a bagel + +| BasketCheckout | ApplyDiscount() | Method that applies discount on the basket | void | +| BasketCheckout | CalculateDiscount() | Mrthod that calculates and returns Discount | int | + +### Receipts + +- As a customer I want to get an receipt to be able to verify that my order is correct +- As an employee at Bob's Bagels I want to assure the customer that they got the right order \ No newline at end of file diff --git a/exercise.main/Basket.cs b/exercise.main/Basket.cs new file mode 100644 index 00000000..6e53fa06 --- /dev/null +++ b/exercise.main/Basket.cs @@ -0,0 +1,70 @@ +using exercise.main.StoreItem; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main +{ + public class Basket + { + public List storeItems = new List(); + public int ItemCount { get { return storeItems.Count; } } + + public Basket(int capacity = 20) + { + Capacity = capacity; + } + + public int Capacity { get; set; } + + public void Add(IStoreItem storeItem) + { + storeItems.Add(storeItem); + } + + public bool BasketHas(IStoreItem storeItem) + { + return storeItems.Contains(storeItem); + } + + public bool IsFull() + { + return storeItems.Count >= Capacity; + } + + public void Remove(IStoreItem storeItem) + { + if (storeItems.Contains(storeItem)) + { + storeItems.Remove(storeItem); + } + } + + public int CountOccurences(string sku) + { + int count = 0; + foreach(IStoreItem item in storeItems) + { + if (item.Sku == sku) count++; + } + return count; + } + + public decimal TotalCost() + { + decimal totalPrice = 0; + foreach(IStoreItem storeItem in storeItems) + { + totalPrice += storeItem.Price; + } + return totalPrice; + } + + public void ClearBasket() + { + storeItems.Clear(); + } + } +} diff --git a/exercise.main/BasketCheckout.cs b/exercise.main/BasketCheckout.cs new file mode 100644 index 00000000..f25bc981 --- /dev/null +++ b/exercise.main/BasketCheckout.cs @@ -0,0 +1,118 @@ +using exercise.main.StoreItem; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main +{ + public class BasketCheckout + { + public Basket basket; + public decimal originalCost; + public decimal discountCost; + public decimal discountTotal{ get { return originalCost - discountCost; } } + public Store Store { get; set; } + + public BasketCheckout(Basket b, Store store) + { + basket = b; + originalCost = basket.TotalCost(); + Store = store; + } + + private bool hasTwelveOfSameBagel(string sku) + { + bool isBagel = Store.InventoryDict[sku].Name == "Bagel"; + int occurences = basket.CountOccurences(sku); + return (isBagel && occurences >= 12); + } + private bool hasSixOfSameBagel(string sku) + { + bool isBagel = Store.InventoryDict[sku].Name == "Bagel"; + int occurences = basket.CountOccurences(sku); + return (isBagel && occurences >= 6); + } + + private bool hasCoffeeAndBagel() + { + bool hasBagel = basket.storeItems.Any(i => Store.InventoryDict.ContainsKey(i.Sku) && Store.InventoryDict[i.Sku].Name == "Bagel"); + bool hasCoffee = basket.storeItems.Any(i => Store.InventoryDict.ContainsKey(i.Sku) && Store.InventoryDict[i.Sku].Name == "Coffee"); + + return (hasBagel && hasCoffee); + } + + + + + public List coffeeSorted() + { + List onlyCoffee = basket.storeItems.FindAll(i => Store.InventoryDict[i.Sku].Name == "Coffee"); + List coffeeSorted = onlyCoffee.OrderByDescending(i => i.Price).ToList(); + return coffeeSorted; + } + public List bagelSorted() + { + List onlyBagel = basket.storeItems.FindAll(i => Store.InventoryDict[i.Sku].Name == "Bagel"); + List bagelSorted = onlyBagel.OrderByDescending(i => i.Price).ToList(); + return bagelSorted; + } + + + public decimal calculateDiscountCAndB() + { + decimal discount = 0; + if (hasCoffeeAndBagel()) + { + decimal maxCoffeePrice = coffeeSorted().First().Price; + decimal maxBagelPrice = bagelSorted().First().Price; + discount = (maxCoffeePrice + maxBagelPrice) - 1.25m ; + } + return discount; + } + + public decimal calculateDiscountBagels() + { + decimal discount = 0; + List bagelSort = bagelSorted(); + foreach(IStoreItem bagel in bagelSort) + { + if (hasTwelveOfSameBagel(bagel.Sku)) + { + if(discount < (bagel.Price*12) - 3.99m) + { + discount = (bagel.Price * 12) - 3.99m; + } + } + else if (hasSixOfSameBagel(bagel.Sku)) + { + if (discount < (bagel.Price * 6) - 2.49m) + { + discount = (bagel.Price * 6) - 2.49m; + } + } + } + return discount; + } + + public void applyDiscount() + { + decimal maxDiscount = 0; + if (hasCoffeeAndBagel()) + { + decimal currentDiscount = calculateDiscountCAndB(); + if (currentDiscount > maxDiscount) + { + maxDiscount = currentDiscount; + } + } + decimal bagelDiscount = calculateDiscountBagels(); + if(bagelDiscount > maxDiscount) + { + maxDiscount = bagelDiscount; + } + discountCost = originalCost - maxDiscount; + } + } +} diff --git a/exercise.main/IReceipt.cs b/exercise.main/IReceipt.cs new file mode 100644 index 00000000..92ed46d6 --- /dev/null +++ b/exercise.main/IReceipt.cs @@ -0,0 +1,18 @@ +using exercise.main.StoreItem; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main +{ + public interface IReceipt { + + string buildReceipt(); + + void printReceipt(); + + + } +} diff --git a/exercise.main/Inventory.cs b/exercise.main/Inventory.cs new file mode 100644 index 00000000..c47f8b4e --- /dev/null +++ b/exercise.main/Inventory.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main +{ + public class Inventory + { + public Inventory(string sku, decimal price, string name, string variant) + { + Sku = sku; + Price = price; + Name = name; + Variant = variant; + } + + public string Sku { get; } + public decimal Price { get; } + public string Name { get; } + public string Variant { get; } + } +} diff --git a/exercise.main/Program.cs b/exercise.main/Program.cs index 3751555c..3ed0e5d7 100644 --- a/exercise.main/Program.cs +++ b/exercise.main/Program.cs @@ -1,2 +1,3 @@ // See https://aka.ms/new-console-template for more information Console.WriteLine("Hello, World!"); + diff --git a/exercise.main/Receipt.cs b/exercise.main/Receipt.cs new file mode 100644 index 00000000..39ac6088 --- /dev/null +++ b/exercise.main/Receipt.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using exercise.main.StoreItem; + +namespace exercise.main +{ + public class Receipt : IReceipt + { + private BasketCheckout _checkout; + private DateTime dateTime; + private Dictionary _itemOccurences; + private Dictionary _itemsPrices; + private string receiptString = ""; + + + public Receipt(BasketCheckout c) + { + _checkout = c; + _itemOccurences = new Dictionary(); + _itemsPrices = new Dictionary(); + updateAttributes(); + } + + private void updateAttributes() + { + List items = _checkout.basket.storeItems; + foreach (IStoreItem item in items) + { + string s = item.Sku; + if (_itemOccurences.ContainsKey(s)) + { + _itemOccurences[s]++; + _itemsPrices[s] += item.Price; + } + else + { + _itemOccurences[s] = 1; + _itemsPrices[s] = item.Price; + } + } + } + public string buildReceipt() + { + int totalLength = 30; + List alreadyAdded = new List(); + List items = _checkout.basket.storeItems; + dateTime = DateTime.Now; + StringBuilder receipt = new StringBuilder(); + string name = _checkout.Store.Name; + receipt.AppendLine(" ---- "+name+" ---- "); + receipt.AppendLine(); + int dateTimePadding = (int)Math.Ceiling((double)(36 - dateTime.ToString().Length) / 2); + receipt.Append(' ', dateTimePadding); + receipt.Append(dateTime); + receipt.Append(' ', dateTimePadding); + receipt.AppendLine(); + receipt.Append('-', 40); + receipt.AppendLine(); + foreach (IStoreItem item in items) { + if (!alreadyAdded.Contains(item.Sku)) { + string itemName = _checkout.Store.InventoryDict[item.Sku].Name+" "+item.Variant; + int itemOcc = _itemOccurences[item.Sku]; + decimal itemPrice = Math.Round(_itemsPrices[item.Sku], 2); + int namePadding = 20 - itemName.Length; + int digitCount = itemOcc.ToString().Length; + int decimalCount = itemPrice.ToString().Length; + int pricePadding = 10 - (digitCount - decimalCount); + receipt.Append(itemName); + receipt.Append(' ', namePadding); + receipt.Append(itemOcc.ToString()); + receipt.Append(' ', pricePadding); + receipt.Append(itemPrice.ToString()); + receipt.AppendLine(); + alreadyAdded.Add(item.Sku); + } + } + + receipt.Append('-', 40); + receipt.AppendLine(); + receipt.Append(' ', 38 - (_checkout.originalCost.ToString().Length)); + receipt.Append(_checkout.originalCost.ToString()); + receipt.AppendLine(); + receipt.Append("Discount:"); + receipt.Append(' ', 26 - (_checkout.discountTotal.ToString().Length)); + receipt.Append(" - "+_checkout.discountTotal.ToString()); + receipt.AppendLine(); + receipt.AppendLine(); + receipt.Append("Total"); + receipt.Append(' ', 33-(_checkout.discountCost.ToString().Length)); + receipt.Append(_checkout.discountCost.ToString()); + receipt.AppendLine(); + receipt.Append('-', 40); + receipt.AppendLine(); + + string thanks = "Thank you for your order!"; + receipt.AppendLine(" "+thanks); + + return receipt.ToString(); + } + + public void setReceipt() + { + receiptString = string.Empty; + } + + public void printReceipt() + { + Console.Write(buildReceipt()); + } + } +} diff --git a/exercise.main/Store.cs b/exercise.main/Store.cs new file mode 100644 index 00000000..01545c35 --- /dev/null +++ b/exercise.main/Store.cs @@ -0,0 +1,99 @@ +using exercise.main.StoreItem; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main +{ + public class Store + + { + public Store(string name, int cap) + { + Name = name; + MaxCapacity = cap; + InventoryDict = new Dictionary(); + } + + public string Name { get; set; } + public int MaxCapacity { get; set; } + public Dictionary InventoryDict { get; set;} + + public void AddInventory(Inventory invItem) + { + InventoryDict[invItem.Sku] = invItem; + } + + public void AddItemToBasket(IStoreItem item, Basket basket) + { + basket.Add(item); + } + + public Bagel CreateBagel(string sku) + { + Inventory invItem = InventoryDict[sku]; + if (invItem.Name == "Bagel") + { + return new Bagel(sku, invItem.Variant, invItem.Price); + } + else { + throw new Exception("Sku doesn't exist or isn't a Bagel"); + } + + } + + public Coffee CreateCoffee(string sku) + { + Inventory invItem = InventoryDict[sku]; + if (invItem.Name == "Coffee") + { + return new Coffee(sku, invItem.Variant, invItem.Price); + } + else + { + throw new Exception("Sku doesn't exist or isn't a Coffee"); + } + + } + + + public Filling CreateFilling(string sku) + { + Inventory invItem = InventoryDict[sku]; + if (invItem.Name == "Filling") + { + return new Filling(sku, invItem.Variant, invItem.Price); + } + else + { + throw new Exception("Sku doesn't exist or isn't a Filling"); + } + + } + + + public bool StoreHasItem(IStoreItem storeItem) + { + //bool hasItem = true; + string sku = storeItem.Sku; + if (InventoryDict.ContainsKey(sku)) + { + Inventory invItem = InventoryDict[sku]; + return (storeItem.Price == invItem.Price && storeItem.Variant == invItem.Variant); + } + return false; + } + + public Basket CreateBasket() + { + return new Basket(MaxCapacity); + } + + public void AddFillToBagel(Bagel bagel, Filling fill) + { + bagel.AddFilling(fill); + } + } +} diff --git a/exercise.main/StoreItem/Bagel.cs b/exercise.main/StoreItem/Bagel.cs new file mode 100644 index 00000000..4c0f7ce8 --- /dev/null +++ b/exercise.main/StoreItem/Bagel.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main.StoreItem +{ + public class Bagel : IStoreItem + + { + public string Sku { get; set; } + public string Variant { get; set; } + private decimal _bagelPrice { get; set; } + public decimal Price { get { return GetTotalPrice();} } + + public List Fillings = new List(); + + public Bagel(string sku, string variant, decimal price) + { + Sku = sku; + Variant = variant; + _bagelPrice = price; + } + + public void AddFilling(Filling filling) + { + Fillings.Add(filling); + } + + public void RemoveFilling(Filling filling) + { + if (Fillings.Contains(filling)) + { + Fillings.Remove(filling); + } + } + + public decimal GetTotalPrice() + { + decimal totalPrice = _bagelPrice; + foreach (Filling filling in Fillings) { + totalPrice += filling.Price; + } + return totalPrice; + } + + // To keep it simple a bagel is equivalent only if it has the equivalent filling in the same order + // The fillings doesnt have to be the same Filling object, but be equivalent. This means that this function + // doesn't consider an egg and bacon bagel to be equivalent to a bacon and egg bagel + public bool Equivalent(Bagel item) + { + + bool sameFillings = item.Fillings.Count == Fillings.Count; + if (sameFillings) + { + for (int i = 0; i < Fillings.Count; i++) + { + if (!item.Fillings[i].Equivalent(Fillings[i])) + { + sameFillings = false; + } + } + } + return( + item.GetType() == this.GetType() && + item.Sku == this.Sku && + item.Variant == this.Variant && + item.Price == this.Price && + sameFillings); + } + + public IStoreItem Copy() + { + Bagel copyBagel = new Bagel(Sku, Variant, _bagelPrice); + List copyFillings = new List(); + foreach (Filling filling in Fillings) + { + Filling copyFilling = (Filling)filling.Copy(); + copyBagel.AddFilling(copyFilling); + } + return copyBagel; + } + } +} diff --git a/exercise.main/StoreItem/Coffee.cs b/exercise.main/StoreItem/Coffee.cs new file mode 100644 index 00000000..5c80e775 --- /dev/null +++ b/exercise.main/StoreItem/Coffee.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main.StoreItem +{ + public class Coffee : IStoreItem + + { + public string Sku { get; set; } + public string Variant { get; set; } + public decimal Price { get; set; } + + public Coffee(string sku, string variant, decimal price) + { + Sku = sku; + Variant = variant; + Price = price; + } + + public bool Equivalent(IStoreItem item) + { + return ( + item.GetType() == this.GetType() && + item.Sku == this.Sku && + item.Variant == this.Variant && + item.Price == this.Price); + } + + public IStoreItem Copy() + { + return new Coffee(Sku, Variant, Price); + } + } +} diff --git a/exercise.main/StoreItem/Filling.cs b/exercise.main/StoreItem/Filling.cs new file mode 100644 index 00000000..74a96b58 --- /dev/null +++ b/exercise.main/StoreItem/Filling.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main.StoreItem +{ + public class Filling : IStoreItem + + { + public string Sku { get; set; } + public string Variant { get; set; } + public decimal Price { get; set; } + + public Filling(string sku, string variant, decimal price) + { + Sku = sku; + Variant = variant; + Price = price; + } + + public bool Equivalent(IStoreItem item) + { + return ( + item.GetType() == this.GetType() && + item.Sku == this.Sku && + item.Variant == this.Variant && + item.Price == this.Price); + } + + public IStoreItem Copy() + { + return new Filling(Sku, Variant, Price); + } + } +} + diff --git a/exercise.main/StoreItem/IStoreItem.cs b/exercise.main/StoreItem/IStoreItem.cs new file mode 100644 index 00000000..c54a0ac6 --- /dev/null +++ b/exercise.main/StoreItem/IStoreItem.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace exercise.main.StoreItem +{ + public interface IStoreItem + { + string Sku { get; set; } + decimal Price { get; } + string Variant { get; set; } + + //bool Equivalent(IStoreItem item); + + IStoreItem Copy(); + } +} diff --git a/exercise.sln b/exercise.sln index 0efb5453..a4ab1ec1 100644 --- a/exercise.sln +++ b/exercise.sln @@ -9,6 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "exercise.tests", "exercise. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825CCFE7-4F2E-4770-8393-FEB732F66EE4}" ProjectSection(SolutionItems) = preProject + domain-model.md = domain-model.md extension1.md = extension1.md extension2.md = extension2.md extension3.md = extension3.md @@ -34,4 +35,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {920D886A-597D-4644-84C5-CCCDE72D64DC} + EndGlobalSection EndGlobal diff --git a/exercise.tests/BasketTests.cs b/exercise.tests/BasketTests.cs new file mode 100644 index 00000000..fb575693 --- /dev/null +++ b/exercise.tests/BasketTests.cs @@ -0,0 +1,122 @@ +using exercise.main; +using exercise.main.StoreItem; +using System.Reflection.Emit; + +namespace exercise.tests; + +public class BasketTests +{ + [Test] + public void AddTwoBagelTest() + { + Bagel bagel1 = new Bagel("TEST1", "testBagel1", 0.59m); + Bagel bagel2 = new Bagel("TEST2", "testBagel2", 0.59m); + Basket basket = new Basket(); + basket.Add(bagel1); + basket.Add(bagel2); + + int ItemsInBasket = basket.ItemCount; + + Assert.That(ItemsInBasket == 2 && basket.BasketHas(bagel1) && basket.BasketHas(bagel2)); + } + public void AddBagelWithFillingTest() + { + Bagel bagel = new Bagel("TEST", "testBagel", 0.59m); + Filling filling = new Filling("FILL", "testFill", 0.15m); + Basket basket = new Basket(); + + bagel.AddFilling(filling); + basket.Add(bagel); + + int ItemsInBasket = basket.ItemCount; + + Assert.That(ItemsInBasket == 1 && basket.BasketHas(bagel)); + } + + [Test] + public void RemoveOneBagelTest() + { + Bagel bagel1 = new Bagel("TEST1", "testBagel1", 0.59m); + Bagel bagel2 = new Bagel("TEST2", "testBagel2", 0.59m); + Basket basket = new Basket(); + basket.Add(bagel1); + basket.Add(bagel2); + basket.Remove(bagel2); + int ItemsInBasket = basket.ItemCount; + + Assert.That(ItemsInBasket == 1 && basket.BasketHas(bagel1) && !basket.BasketHas(bagel2)); + } + + [Test] + public void BasketNotFullTest() + { + Bagel bagel = new Bagel("TEST", "testBagel", 0.59m); + Basket basket = new Basket(); + basket.Add(bagel); + + Assert.That(!basket.IsFull()); + } + + [Test] + public void BasketFullTest() + { + Bagel bagel1 = new Bagel("TEST1", "testBagel1", 0.59m); + Bagel bagel2 = new Bagel("TEST2", "testBagel2", 0.59m); + Bagel bagel3 = new Bagel("TEST3", "testBagel3", 0.59m); + + Basket basket = new Basket(3); + basket.Add(bagel1); + basket.Add(bagel2); + basket.Add(bagel3); + + Assert.That(basket.IsFull()); + } + + [Test] + public void BasketPriceTest() + { + Bagel bagel1 = new Bagel("TEST1", "testBagel1", 0.59m); + Bagel bagel2 = new Bagel("TEST2", "testBagel2", 0.49m); + Bagel bagel3 = new Bagel("TEST3", "testBagel3", 0.59m); + + Basket basket = new Basket(); + basket.Add(bagel1); + basket.Add(bagel2); + basket.Add(bagel3); + Decimal expectedPrice = 1.67m; + Decimal actualPrice = basket.TotalCost(); + + Assert.That(expectedPrice == actualPrice); + } + + [Test] + public void BasketWithFillTest() + { + Bagel bagel = new Bagel("TEST", "testBagel", 0.59m); + Filling filling = new Filling("FILL", "testFill", 0.16m); + bagel.AddFilling(filling); + Basket basket = new Basket(); + basket.Add(bagel); + + Decimal expectedPrice = 0.75m; + Decimal actualPrice = basket.TotalCost(); + Assert.That(expectedPrice == actualPrice); + } + [Test] + public void BasketClearTest() + { + Bagel bagel1 = new Bagel("TEST1", "testBagel1", 0.59m); + Bagel bagel2 = new Bagel("TEST2", "testBagel2", 0.59m); + Bagel bagel3 = new Bagel("TEST3", "testBagel3", 0.59m); + + Basket basket = new Basket(3); + basket.Add(bagel1); + basket.Add(bagel2); + basket.Add(bagel3); + bool isFullBeforeClear = basket.IsFull(); + basket.ClearBasket(); + int ItemsInBasket = basket.ItemCount; + Assert.That(isFullBeforeClear && ItemsInBasket == 0); + } + +} \ No newline at end of file diff --git a/exercise.tests/DiscountTests.cs b/exercise.tests/DiscountTests.cs new file mode 100644 index 00000000..39cf624f --- /dev/null +++ b/exercise.tests/DiscountTests.cs @@ -0,0 +1,228 @@ +using exercise.main; +using exercise.main.StoreItem; + +namespace exercise.tests; + +public class DiscountTests +{ + [SetUp] + public void Setup() + { + } + + [Test] + public void TestCoffeeAndBagel() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + Bagel myBagel = store.CreateBagel("BGLO"); + Coffee myCoffee = store.CreateCoffee("COFW"); + + store.AddItemToBasket(myBagel, storeBasket); + store.AddItemToBasket(myCoffee, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + + checkout.applyDiscount(); + decimal discountTest = checkout.discountTotal; + + Assert.That(discountTest == 0.43m); + } + + [Test] + public void TestSixBagelsAndCoffee() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + for(int i = 0; i<6; i++) + { + Bagel myBagel = store.CreateBagel("BGLO"); + store.AddItemToBasket(myBagel, storeBasket); + } + Bagel myPlainBagel = store.CreateBagel("BGLP"); + store.AddItemToBasket(myPlainBagel, storeBasket); + + Coffee myCoffee = store.CreateCoffee("COFW"); + + store.AddItemToBasket(myCoffee, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + + checkout.applyDiscount(); + decimal discountTest = checkout.discountTotal; + + Assert.AreEqual(discountTest, 0.45m); + } + [Test] + public void TestSixBagelsNoCoffee() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + for (int i = 0; i < 6; i++) + { + Bagel myBagel = store.CreateBagel("BGLO"); + store.AddItemToBasket(myBagel, storeBasket); + } + Bagel myPlainBagel = store.CreateBagel("BGLP"); + store.AddItemToBasket(myPlainBagel, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + + checkout.applyDiscount(); + decimal discountTest = checkout.discountTotal; + + decimal discountBagels = checkout.calculateDiscountBagels(); + + Assert.AreEqual(discountTest, discountBagels); + Assert.AreEqual(discountTest, 0.45m); + } + + [Test] + public void TestTwelveOnionBagelsAndCoffee() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + for (int i = 0; i < 12; i++) + { + Bagel myBagel = store.CreateBagel("BGLO"); + store.AddItemToBasket(myBagel, storeBasket); + } + Bagel myPlainBagel = store.CreateBagel("BGLP"); + store.AddItemToBasket(myPlainBagel, storeBasket); + + Coffee myCoffee = store.CreateCoffee("COFW"); + store.AddItemToBasket(myCoffee, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + + checkout.applyDiscount(); + decimal discountTest = checkout.discountTotal; + + decimal discountBagels = checkout.calculateDiscountBagels(); + + Assert.AreEqual(discountTest, discountBagels); + Assert.AreEqual(discountTest, 1.89m); + } + [Test] + public void TestTwelvePlainBagels() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + for (int i = 0; i < 12; i++) + { + Bagel myBagel = store.CreateBagel("BGLP"); + store.AddItemToBasket(myBagel, storeBasket); + } + Bagel myPlainBagel = store.CreateBagel("BGLO"); + store.AddItemToBasket(myPlainBagel, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + + checkout.applyDiscount(); + decimal discountTest = checkout.discountTotal; + + decimal discountBagels = checkout.calculateDiscountBagels(); + + Assert.AreEqual(discountTest, discountBagels); + Assert.AreEqual(discountTest, 0.69m); + } + [Test] + public void TestTwelveBagelsAndCoffee() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + for (int i = 0; i < 12; i++) + { + Bagel myOnionBagel = store.CreateBagel("BGLO"); + store.AddItemToBasket(myOnionBagel, storeBasket); + } + Bagel myBagel = store.CreateBagel("BGLO"); + Coffee myCoffee = store.CreateCoffee("COFW"); + + store.AddItemToBasket(myBagel, storeBasket); + store.AddItemToBasket(myCoffee, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + checkout.applyDiscount(); + + decimal discountTest = checkout.discountTotal; + + decimal discountBagels = checkout.calculateDiscountBagels(); + + Assert.AreEqual(discountTest, discountBagels); + Assert.AreEqual(discountTest, 1.89m); + + } +} diff --git a/exercise.tests/InventoryTests.cs b/exercise.tests/InventoryTests.cs new file mode 100644 index 00000000..8985f84a --- /dev/null +++ b/exercise.tests/InventoryTests.cs @@ -0,0 +1,18 @@ +using exercise.main; + +namespace exercise.tests; + +public class InventoryTests +{ + [SetUp] + public void Setup() + { + } + + [Test] + public void CreateInventoryItemTest() + { + Inventory testInv = new Inventory("TEST", 0.50m, "Bagel", "TestBagel"); + Assert.That(testInv.Sku == "TEST" && testInv.Price == 0.50m && testInv.Name == "Bagel" && testInv.Variant == "TestBagel"); + } +} diff --git a/exercise.tests/ReceiptTest.cs b/exercise.tests/ReceiptTest.cs new file mode 100644 index 00000000..0c77e538 --- /dev/null +++ b/exercise.tests/ReceiptTest.cs @@ -0,0 +1,52 @@ +using exercise.main; +using exercise.main.StoreItem; + +namespace exercise.tests; + +public class ReceiptTest +{ + [SetUp] + public void Setup() + { + } + + [Test] + public void BuildReceipt() + { + Store store = new Store("Bob's TestBagels", 50); + Basket storeBasket = store.CreateBasket(); + Inventory onionBagel = new Inventory("BGLO", 0.49m, "Bagel", "Onion"); + Inventory plainBagel = new Inventory("BGLP", 0.39m, "Bagel", "Plain"); + Inventory coffeeLatte = new Inventory("COFL", 1.29m, "Coffee", "Latte"); + Inventory coffeeWhite = new Inventory("COFW", 1.19m, "Coffee", "White"); + Inventory coffeeBlack = new Inventory("COFB", 0.99m, "Coffee", "Black"); + + store.AddInventory(onionBagel); + store.AddInventory(plainBagel); + store.AddInventory(coffeeLatte); + store.AddInventory(coffeeWhite); + store.AddInventory(coffeeBlack); + + for (int i = 0; i < 12; i++) + { + Bagel myBagel = store.CreateBagel("BGLO"); + store.AddItemToBasket(myBagel, storeBasket); + } + Bagel myPlainBagel = store.CreateBagel("BGLP"); + store.AddItemToBasket(myPlainBagel, storeBasket); + + Coffee myCoffee = store.CreateCoffee("COFW"); + store.AddItemToBasket(myCoffee, storeBasket); + + BasketCheckout checkout = new BasketCheckout(storeBasket, store); + + checkout.applyDiscount(); + + Receipt receipt = new Receipt(checkout); + + string receiptString = receipt.buildReceipt(); + + Assert.AreEqual(receiptString.GetType(), typeof(string)); + receipt.printReceipt(); + } +} diff --git a/exercise.tests/StoreItemTests.cs b/exercise.tests/StoreItemTests.cs new file mode 100644 index 00000000..d0149856 --- /dev/null +++ b/exercise.tests/StoreItemTests.cs @@ -0,0 +1,190 @@ +using exercise.main.StoreItem; + +namespace exercise.tests; +public class StoreItemTests +{ + + [Test] + public void FillingTest() + { + Filling testFilling = new Filling("TEST", "testFilling", 1.99m); + Decimal expectedPrice = 1.99m; + string expectedSku = "TEST"; + string expectedVariant = "testFilling"; + Assert.That( + testFilling.Sku == expectedSku && + testFilling.Variant == expectedVariant && + testFilling.Price == expectedPrice); + } + + [Test] + public void CoffeeTest() + { + Coffee testCoffee = new Coffee("TEST", "testCoffee", 1.59m); + Decimal expectedPrice = 1.59m; + string expectedSku = "TEST"; + string expectedVariant = "testCoffee"; + Assert.That( + testCoffee.Sku == expectedSku && + testCoffee.Variant == expectedVariant && + testCoffee.Price == expectedPrice); + } + [Test] + public void BagelTest() + { + Bagel testBagel = new Bagel("TEST", "testBagel", 0.59m); + Decimal expectedPrice = 0.59m; + string expectedSku = "TEST"; + string expectedVariant = "testBagel"; + Assert.That( + testBagel.Sku == expectedSku && + testBagel.Variant == expectedVariant && + testBagel.Price == expectedPrice); + } + + [Test] + public void BagelFillingTest() + { + Bagel testBagel = new Bagel("TEST", "testBagel", 0.59m); + Filling testFilling = new Filling("TEST", "testFilling", 0.11m); + + testBagel.AddFilling(testFilling); + + Decimal expectedPrice = 0.70m; + Decimal bagelPrice = testBagel.GetTotalPrice(); + + Assert.That(bagelPrice == expectedPrice && testBagel.Fillings.Contains(testFilling)); + } + + [Test] + public void BagelRemoveFillingTest() + { + Bagel testBagel = new Bagel("TEST", "testBagel", 0.59m); + Filling testFilling1 = new Filling("TEST", "testFilling1", 0.11m); + Filling testFilling2 = new Filling("TEST", "testFilling2", 0.11m); + + + testBagel.AddFilling(testFilling1); + testBagel.AddFilling(testFilling2); + + testBagel.RemoveFilling(testFilling1); + Decimal expectedPrice = 0.70m; + Decimal bagelPrice = testBagel.GetTotalPrice(); + + Assert.That(bagelPrice == expectedPrice && testBagel.Fillings.Contains(testFilling2) && !testBagel.Fillings.Contains(testFilling1)); + } + + [Test] + public void BagelEquivalentTest() + { + Bagel bagel1 = new Bagel("TEST", "testBagel", 0.59m); + Bagel bagel2 = new Bagel("TEST", "testBagel", 0.59m); + + bool shouldBeTrue = bagel1.Equivalent(bagel2); + Assert.That(shouldBeTrue == true); + } + + [Test] + public void CoffeeEquivalentTest() + { + Coffee coffee1 = new Coffee("TEST", "testCoffee", 0.59m); + Coffee coffee2 = new Coffee("TEST", "testCoffee", 0.59m); + + bool shouldBeTrue = coffee1.Equivalent(coffee2); + Assert.That(shouldBeTrue == true); + } + + [Test] + public void FillingEquivalentTest() + { + Filling filling1 = new Filling("TEST", "testFilling", 0.59m); + Filling filling2 = new Filling("TEST", "testFilling", 0.59m); + + bool shouldBeTrue = filling1.Equivalent(filling2); + Assert.That(shouldBeTrue == true); + } + + [Test] + public void BagelWithFillingEquivalentTest() + { + { + Bagel bagel1 = new Bagel("TEST", "testBagel", 0.59m); + Bagel bagel2 = new Bagel("TEST", "testBagel", 0.59m); + Filling filling1 = new Filling("TEST", "testFilling", 0.59m); + Filling filling2 = new Filling("TEST", "testFilling", 0.59m); + + bagel1.AddFilling(filling1); + bagel2.AddFilling(filling2); + + bool fillingEquivalent = filling1.Equivalent(filling2); + bool shouldBeTrue = bagel1.Equivalent(bagel2); + Assert.That(shouldBeTrue == true && fillingEquivalent); + } + } + + [Test] + public void BagelWithSameFillingEquivalentTest() + { + { + Bagel bagel1 = new Bagel("TEST", "testBagel", 0.59m); + Bagel bagel2 = new Bagel("TEST", "testBagel", 0.59m); + Filling filling1 = new Filling("TEST", "testFilling", 0.59m); + Filling filling2 = new Filling("TEST", "testFilling", 0.59m); + + bagel1.AddFilling(filling1); + bagel1.AddFilling(filling2); + + bagel2.AddFilling(filling1); + bagel2.AddFilling(filling2); + + bool shouldBeTrue = bagel1.Equivalent(bagel2); + Assert.That(shouldBeTrue == true); + } + } + + [Test] + public void CopyBagelTest() + { + Bagel bagel = new Bagel("TEST", "testBagel", 0.59m); + Bagel copyBagel = (Bagel)bagel.Copy(); + + Assert.That(bagel != copyBagel && bagel.Equivalent(copyBagel)); + } + [Test] + public void CopyBagelNotEquivalentTest() + { + Bagel bagel = new Bagel("TEST", "testBagel", 0.59m); + Bagel copyBagel = (Bagel)bagel.Copy(); + Filling filling = new Filling("TEST", "testFilling", 0.59m); + bagel.AddFilling(filling); + + + Assert.That(bagel != copyBagel && !bagel.Equivalent(copyBagel)); + } + [Test] + public void CopyCoffeeTest() + { + Coffee coffee = new Coffee("TEST", "testCoffee", 0.59m); + Coffee copyCoffee = (Coffee)coffee.Copy(); + + Assert.That(coffee != copyCoffee && coffee.Equivalent(copyCoffee)); + } + [Test] + public void CopyFillingTest() + { + Filling filling = new Filling("TEST", "testFilling", 0.59m); + Filling copyFilling = (Filling)filling.Copy(); + + Assert.That(filling != copyFilling && filling.Equivalent(copyFilling)); + } + [Test] + public void CopyBagelWithFillingTest() + { + Bagel bagel = new Bagel("TEST", "testBagel", 0.59m); + Filling filling = new Filling("TEST", "testFilling", 0.59m); + bagel.AddFilling(filling); + Bagel copyBagel = (Bagel)bagel.Copy(); + + Assert.That(bagel != copyBagel && bagel.Equivalent(copyBagel)); + } +} diff --git a/exercise.tests/StoreTests.cs b/exercise.tests/StoreTests.cs new file mode 100644 index 00000000..abd48389 --- /dev/null +++ b/exercise.tests/StoreTests.cs @@ -0,0 +1,119 @@ +using exercise.main; +using exercise.main.StoreItem; + +namespace exercise.tests; + +public class StoreTests +{ + [Test] + public void CreateStoreTest() + { + Store testStore = new Store("testStore", 50); + + Assert.That(testStore.Name == "testStore" && testStore.MaxCapacity == 50 && testStore.InventoryDict.Values.Count == 0); + } + + [Test] + public void AddInventoryTest() + { + Store testStore = new Store("testStore", 50); + Inventory InvItem = new Inventory("TEST", 0.50m, "Bagel", "testBagel"); + testStore.AddInventory(InvItem); + + Assert.That(testStore.InventoryDict.Values.Count == 1); + } + + [Test] + public void StoreHasItemTest() + { + Store testStore = new Store("testStore", 50); + Coffee coffee = new Coffee("COFF", "testCoffee", 1.09m); + Bagel bagel = new Bagel("TEST", "testBagel", 0.50m); + Inventory InvItemB = new Inventory("TEST", 0.50m, "Bagel", "testBagel"); + Inventory InvItemC = new Inventory("COFF", 1.09m, "Coffee", "testCoffee"); + + testStore.AddInventory(InvItemB); + testStore.AddInventory(InvItemC); + bool resultB = testStore.StoreHasItem(bagel); + bool resultC = testStore.StoreHasItem(coffee); + + Assert.That(resultB && resultC && testStore.InventoryDict.Values.Count == 2); + } + + [Test] + public void CreateBagelItemTest() + { + Store testStore = new Store("testStore", 50); + Inventory InvItemB = new Inventory("TEST", 0.50m, "Bagel", "testBagel"); + testStore.AddInventory(InvItemB); + Bagel bagel = testStore.CreateBagel("TEST"); + + Assert.That(bagel.Sku == "TEST" && bagel.Price == 0.50m && bagel.Variant == "testBagel"); + } + + [Test] + public void CreateCoffeeTest() + { + Store testStore = new Store("testStore", 50); + Inventory InvItemC = new Inventory("TEST", 0.50m, "Coffee", "testCoffee"); + testStore.AddInventory(InvItemC); + Coffee coffee = testStore.CreateCoffee("TEST"); + + Assert.That(coffee.Sku == "TEST" && coffee.Price == 0.50m && coffee.Variant == "testCoffee"); + } + + [Test] + public void CreateFillingTest() + { + Store testStore = new Store("testStore", 50); + Inventory InvItemF = new Inventory("TEST", 0.50m, "Filling", "testFilling"); + testStore.AddInventory(InvItemF); + Filling filling = testStore.CreateFilling("TEST"); + + Assert.That(filling.Sku == "TEST" && filling.Price == 0.50m && filling.Variant == "testFilling"); + } + + [Test] + public void CreateBasketTest() + { + Store testStore = new Store("testStore", 50); + Basket basket = testStore.CreateBasket(); + + Assert.That(basket.Capacity == 50); + } + + [Test] + public void AddFillToBagelTest() + { + Store testStore = new Store("testStore", 50); + Inventory InvItemB = new Inventory("TEST", 0.50m, "Bagel", "testBagel"); + Inventory InvItemF = new Inventory("FILL", 0.39m, "Filling", "testFilling"); + + testStore.AddInventory(InvItemB); + testStore.AddInventory(InvItemF); + + Bagel bagel = testStore.CreateBagel("TEST"); + Filling fill = testStore.CreateFilling("FILL"); + testStore.AddFillToBagel(bagel, fill); + + Assert.That(bagel.Sku == "TEST" && bagel.Price == 0.89m && bagel.Variant == "testBagel" && bagel.Fillings.Contains(fill)); + } + [Test] + public void AddItemToBasketTest() + { + Store testStore = new Store("testStore", 50); + Basket basket = testStore.CreateBasket(); + Inventory InvItemB = new Inventory("TEST", 0.50m, "Bagel", "testBagel"); + Inventory InvItemF = new Inventory("FILL", 0.39m, "Filling", "testFilling"); + + testStore.AddInventory(InvItemB); + testStore.AddInventory(InvItemF); + + Bagel bagel = testStore.CreateBagel("TEST"); + Filling fill = testStore.CreateFilling("FILL"); + testStore.AddFillToBagel(bagel, fill); + + testStore.AddItemToBasket(bagel, basket); + Assert.That(basket.BasketHas(bagel) && basket.TotalCost() == 0.89m); + } +} diff --git a/exercise.tests/UnitTest1.cs b/exercise.tests/UnitTest1.cs deleted file mode 100644 index 7bdb8968..00000000 --- a/exercise.tests/UnitTest1.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace exercise.tests; - -public class Tests -{ - [SetUp] - public void Setup() - { - } - - [Test] - public void Test1() - { - Assert.Pass(); - } -} \ No newline at end of file diff --git a/exercise.tests/exercise.tests.csproj b/exercise.tests/exercise.tests.csproj index 9fed8e17..a3a97d4f 100644 --- a/exercise.tests/exercise.tests.csproj +++ b/exercise.tests/exercise.tests.csproj @@ -17,4 +17,8 @@ + + + +