Commit 937c481e authored by islater's avatar islater
Browse files

Merge branch 'master' of https://github.com/ksu-cis/cowboy-cafe

parents e10116a0 d814a882
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
/*
namespace CowboyCafe.DataTests
{
public class CowboyCoffeeTest
{
[Fact]
public void ShouldNotBeIcedByDefault()
{
var coffee = new CowboyCoffee();
Assert.False(coffee.Ice);
}
[Fact]
public void ShouldBeAbleToSetIce()
{
var coffee = new CowboyCoffee();
coffee.Ice = true;
Assert.True(coffee.Ice);
coffee.Ice = false;
Assert.False(coffee.Ice);
}
[Fact]
public void ShouldBeCaffinatedByDefault()
{
var coffee = new CowboyCoffee();
Assert.False(coffee.Decaf);
}
[Fact]
public void ShouldBeAbleToSetDecaf()
{
var coffee = new CowboyCoffee();
coffee.Decaf = true;
Assert.True(coffee.Decaf);
coffee.Decaf = false;
Assert.False(coffee.Decaf);
}
[Fact]
public void ShouldNotHaveRoomForCreamByDefault()
{
var coffee = new CowboyCoffee();
Assert.False(coffee.RoomForCream);
}
[Fact]
public void ShouldBeAbleToSetRoomForCream()
{
var coffee = new CowboyCoffee();
coffee.RoomForCream = true;
Assert.True(coffee.RoomForCream);
coffee.RoomForCream = false;
Assert.False(coffee.RoomForCream);
}
[Fact]
public void ShouldBeSmallByDefault()
{
var coffee = new CowboyCoffee();
Assert.Equal(Size.Small, coffee.Size);
}
[Fact]
public void ShouldBeAbleToSetSize()
{
var coffee = new CowboyCoffee();
coffee.Size = Size.Large;
Assert.Equal(Size.Large, coffee.Size);
coffee.Size = Size.Medium;
Assert.Equal(Size.Medium, coffee.Size);
coffee.Size = Size.Small;
Assert.Equal(Size.Small, coffee.Size);
}
[Theory]
[InlineData(Size.Small, 0.60)]
[InlineData(Size.Medium, 1.10)]
[InlineData(Size.Large, 1.60)]
public void ShouldHaveCorrectPriceForSize(Size size, double price)
{
var coffee = new CowboyCoffee()
{
Size = size
};
Assert.Equal(price, coffee.Price);
}
[Theory]
[InlineData(Size.Small, 3)]
[InlineData(Size.Medium, 5)]
[InlineData(Size.Large, 7)]
public void ShouldHaveCorrectCaloriesForSize(Size size, uint calories)
{
var coffee = new CowboyCoffee()
{
Size = size
};
Assert.Equal(calories, coffee.Calories);
}
[Theory]
[InlineData(false, false)]
[InlineData(true, false)]
[InlineData(false, true)]
[InlineData(true, true)]
public void ShouldHaveCorrectSpecialInstructionsForIceAndRoomForCream(bool ice, bool roomForCream)
{
var coffee = new CowboyCoffee()
{
Ice = ice,
RoomForCream = roomForCream,
};
if (ice) Assert.Contains("Add Ice", coffee.SpecialInstructions);
if (roomForCream) Assert.Contains("Room for Cream", coffee.SpecialInstructions);
if (!ice && !roomForCream) Assert.Empty(coffee.SpecialInstructions);
if (ice && !roomForCream || !ice && roomForCream) Assert.Single(coffee.SpecialInstructions);
if (ice && roomForCream) Assert.Equal(2, coffee.SpecialInstructions.Count);
}
}
}
*/
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
namespace CowboyCafe.DataTests
{
/*
public class DrinkTests
{
[Theory]
[InlineData(typeof(CowboyCoffee))]
[InlineData(typeof(JerkedSoda))]
[InlineData(typeof(TexasTea))]
[InlineData(typeof(Water))]
public void TypeShouldBeADrink(Type type)
{
var drink = Activator.CreateInstance(type);
Assert.IsAssignableFrom<Drink>(drink);
}
}
*/
}
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
/*
namespace CowboyCafe.DataTests
{
public class JerkedSodaTest
{
[Theory]
[InlineData("CreamSoda")]
[InlineData("OrangeSoda")]
[InlineData("Sarsparilla")]
[InlineData("BirchBeer")]
[InlineData("RootBeer")]
public void SodaFlavorEnumShouldContainFlavor(string name)
{
var names = Enum.GetNames(typeof(SodaFlavor));
Assert.Contains(name, names);
}
[Fact]
public void SodaFlavorEnumShouldHaveFiveValues()
{
var values = Enum.GetValues(typeof(SodaFlavor));
Assert.Equal(5, values.Length);
}
[Theory]
[InlineData("CreamSoda")]
[InlineData("OrangeSoda")]
[InlineData("Sarsparilla")]
[InlineData("BirchBeer")]
[InlineData("RootBeer")]
public void ShouldBeAbleToSetFlavor(string name)
{
var flavor = (SodaFlavor)Enum.Parse(typeof(SodaFlavor), name);
var soda = new JerkedSoda()
{
Flavor = flavor
};
Assert.Equal(flavor, soda.Flavor);
}
[Fact]
public void ShouldBeIcedByDefault()
{
var soda = new JerkedSoda();
Assert.True(soda.Ice);
}
[Fact]
public void ShouldBeAbleToSetIce()
{
var soda = new JerkedSoda();
soda.Ice = false;
Assert.False(soda.Ice);
soda.Ice = true;
Assert.True(soda.Ice);
}
[Fact]
public void ShouldBeSmallByDefault()
{
var soda = new JerkedSoda();
Assert.Equal(Size.Small, soda.Size);
}
[Fact]
public void ShouldBeAbleToSetSize()
{
var soda = new JerkedSoda();
soda.Size = Size.Large;
Assert.Equal(Size.Large, soda.Size);
soda.Size = Size.Medium;
Assert.Equal(Size.Medium, soda.Size);
soda.Size = Size.Small;
Assert.Equal(Size.Small, soda.Size);
}
[Theory]
[InlineData(Size.Small, 1.59)]
[InlineData(Size.Medium, 2.10)]
[InlineData(Size.Large, 2.59)]
public void ShouldHaveCorrectPriceForSize(Size size, double price)
{
var soda = new JerkedSoda()
{
Size = size
};
Assert.Equal(price, soda.Price);
}
[Theory]
[InlineData(Size.Small, 110)]
[InlineData(Size.Medium, 146)]
[InlineData(Size.Large, 198)]
public void ShouldHaveCorrectCaloriesForSize(Size size, uint calories)
{
var soda = new JerkedSoda()
{
Size = size
};
Assert.Equal(calories, soda.Calories);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void ShouldHaveCorrectSpecialInstructionsForIce(bool ice)
{
var soda = new JerkedSoda()
{
Ice = ice
};
if (!ice) Assert.Collection(soda.SpecialInstructions, item => Assert.Equal("Hold Ice", item));
if (ice) Assert.Empty(soda.SpecialInstructions);
}
}
}
*/
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
/*
namespace CowboyCafe.DataTests
{
public class SideTests
{
[Theory]
[InlineData(typeof(ChiliCheeseFries))]
[InlineData(typeof(BakedBeans))]
[InlineData(typeof(CornDodgers))]
[InlineData(typeof(PanDeCampo))]
public void TypeShouldBeASide(Type type)
{
var side = Activator.CreateInstance(type);
Assert.IsAssignableFrom<Side>(side);
}
}
}
*/
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
/*
namespace CowboyCafe.DataTests
{
public class TexasTeaTest
{
[Fact]
public void ShouldBeIcedByDefault()
{
var tea = new TexasTea();
Assert.True(tea.Ice);
}
[Fact]
public void ShouldBeAbleToSetIce()
{
var tea = new TexasTea();
tea.Ice = false;
Assert.False(tea.Ice);
tea.Ice = true;
Assert.True(tea.Ice);
}
[Fact]
public void ShouldBeSweetByDefault()
{
var tea = new TexasTea();
Assert.True(tea.Sweet);
}
[Fact]
public void ShouldBeAbleToSetSweetness()
{
var tea = new TexasTea();
tea.Sweet = false;
Assert.False(tea.Sweet);
tea.Sweet = true;
Assert.True(tea.Sweet);
}
[Fact]
public void ShouldNotHaveLemonByDefault()
{
var tea = new TexasTea();
Assert.False(tea.Lemon);
}
[Fact]
public void ShouldBeAbleToSetLemon()
{
var tea = new TexasTea();
tea.Lemon = true;
Assert.True(tea.Lemon);
tea.Lemon = false;
Assert.False(tea.Lemon);
}
[Fact]
public void ShouldBeSmallByDefault()
{
var tea = new TexasTea();
Assert.Equal(Size.Small, tea.Size);
}
[Fact]
public void ShouldBeAbleToSetSize()
{
var tea = new TexasTea();
tea.Size = Size.Large;
Assert.Equal(Size.Large, tea.Size);
tea.Size = Size.Medium;
Assert.Equal(Size.Medium, tea.Size);
tea.Size = Size.Small;
Assert.Equal(Size.Small, tea.Size);
}
[Theory]
[InlineData(Size.Small, 1.00)]
[InlineData(Size.Medium, 1.50)]
[InlineData(Size.Large, 2.00)]
public void ShouldHaveCorrectPriceForSize(Size size, double price)
{
var tea = new TexasTea()
{
Size = size
};
Assert.Equal(price, tea.Price);
}
[Theory]
[InlineData(Size.Small, true, 10)]
[InlineData(Size.Medium, true, 22)]
[InlineData(Size.Large, true, 36)]
[InlineData(Size.Small, false, 5)]
[InlineData(Size.Medium, false, 11)]
[InlineData(Size.Large, false, 18)]
public void ShouldHaveCorrectCaloriesForSizeAndSweetness(Size size, bool sweet, uint calories)
{
var tea = new TexasTea()
{
Size = size,
Sweet = sweet
};
Assert.Equal(calories, tea.Calories);
}
[Theory]
[InlineData(false, false)]
[InlineData(true, false)]
[InlineData(false, true)]
[InlineData(true, true)]
public void ShouldHaveCorrectSpecialInstructionsForIceAndLemon(bool ice, bool lemon)
{
var tea = new TexasTea()
{
Ice = ice,
Lemon = lemon,
};
if (!ice) Assert.Contains("Hold Ice", tea.SpecialInstructions);
if (lemon) Assert.Contains("Add Lemon", tea.SpecialInstructions);
if (ice && !lemon) Assert.Empty(tea.SpecialInstructions);
if (ice && lemon || !ice && !lemon) Assert.Single(tea.SpecialInstructions);
if (!ice && lemon) Assert.Equal(2, tea.SpecialInstructions.Count);
}
}
}
*/
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
/*
namespace CowboyCafe.DataTests
{
public class ToStringTests
{
[Theory]
[InlineData(typeof(CowpokeChili), "Cowpoke Chili")]
[InlineData(typeof(RustlersRibs), "Rustler's Ribs")]
[InlineData(typeof(PecosPulledPork), "Pecos Pulled Pork")]
[InlineData(typeof(TrailBurger), "Trail Burger")]
[InlineData(typeof(DakotaDoubleBurger), "Dakota Double Burger")]
[InlineData(typeof(TexasTripleBurger), "Texas Triple Burger")]
[InlineData(typeof(AngryChicken), "Angry Chicken")]
public void EntreeToStringShouldMatchExpectations(Type type, string expected)
{
Entree entree = Activator.CreateInstance(type) as Entree;
Assert.Equal(expected, entree.ToString());
}
[Theory]
[InlineData(typeof(ChiliCheeseFries), Size.Small, "Small Chili Cheese Fries")]
[InlineData(typeof(ChiliCheeseFries), Size.Medium, "Medium Chili Cheese Fries")]
[InlineData(typeof(ChiliCheeseFries), Size.Large, "Large Chili Cheese Fries")]
[InlineData(typeof(BakedBeans), Size.Small, "Small Baked Beans")]
[InlineData(typeof(BakedBeans), Size.Medium, "Medium Baked Beans")]
[InlineData(typeof(BakedBeans), Size.Large, "Large Baked Beans")]
[InlineData(typeof(CornDodgers), Size.Small, "Small Corn Dodgers")]
[InlineData(typeof(CornDodgers), Size.Medium, "Medium Corn Dodgers")]
[InlineData(typeof(CornDodgers), Size.Large, "Large Corn Dodgers")]
[InlineData(typeof(PanDeCampo), Size.Small, "Small Pan de Campo")]
[InlineData(typeof(PanDeCampo), Size.Medium, "Medium Pan de Campo")]
[InlineData(typeof(PanDeCampo), Size.Large, "Large Pan de Campo")]
public void SideToStringShouldMatchExpectations(Type type, Size size, string expected)
{
Side side = Activator.CreateInstance(type) as Side;
side.Size = size;
Assert.Equal(expected, side.ToString());
}
[Theory]
[InlineData(Size.Small, "Small Water")]
[InlineData(Size.Medium, "Medium Water")]
[InlineData(Size.Large, "Large Water")]
public void WaterToStringShouldMatchExpectations(Size size, string expected)
{
var water = new Water()
{
Size = size
};
Assert.Equal(expected, water.ToString());
}
[Theory]
[InlineData(SodaFlavor.BirchBeer, Size.Small, "Small Birch Beer Jerked Soda")]
[InlineData(SodaFlavor.BirchBeer, Size.Medium, "Medium Birch Beer Jerked Soda")]
[InlineData(SodaFlavor.BirchBeer, Size.Large, "Large Birch Beer Jerked Soda")]
[InlineData(SodaFlavor.CreamSoda, Size.Small, "Small Cream Soda Jerked Soda")]
[InlineData(SodaFlavor.CreamSoda, Size.Medium, "Medium Cream Soda Jerked Soda")]
[InlineData(SodaFlavor.CreamSoda, Size.Large, "Large Cream Soda Jerked Soda")]
[InlineData(SodaFlavor.OrangeSoda, Size.Small, "Small Orange Soda Jerked Soda")]
[InlineData(SodaFlavor.OrangeSoda, Size.Medium, "Medium Orange Soda Jerked Soda")]
[InlineData(SodaFlavor.OrangeSoda, Size.Large, "Large Orange Soda Jerked Soda")]
[InlineData(SodaFlavor.RootBeer, Size.Small, "Small Root Beer Jerked Soda")]
[InlineData(SodaFlavor.RootBeer, Size.Medium, "Medium Root Beer Jerked Soda")]
[InlineData(SodaFlavor.RootBeer, Size.Large, "Large Root Beer Jerked Soda")]
[InlineData(SodaFlavor.Sarsparilla, Size.Small, "Small Sarsparilla Jerked Soda")]
[InlineData(SodaFlavor.Sarsparilla, Size.Medium, "Medium Sarsparilla Jerked Soda")]
[InlineData(SodaFlavor.Sarsparilla, Size.Large, "Large Sarsparilla Jerked Soda")]
public void JerkedSodaToStringShouldMatchExpectations(SodaFlavor flavor, Size size, string expected)
{
var soda = new JerkedSoda
{
Flavor = flavor,
Size = size
};
Assert.Equal(expected, soda.ToString());
}
[Theory]
[InlineData(Size.Small, false, "Small Texas Plain Tea")]
[InlineData(Size.Medium, false, "Medium Texas Plain Tea")]
[InlineData(Size.Large, false, "Large Texas Plain Tea")]
[InlineData(Size.Small, true, "Small Texas Sweet Tea")]
[InlineData(Size.Medium, true, "Medium Texas Sweet Tea")]
[InlineData(Size.Large, true, "Large Texas Sweet Tea")]
public void TexasTeaToStringShouldMatchExpectations(Size size, bool sweet, string expected)
{
var tea = new TexasTea()
{
Size = size,
Sweet = sweet
};
Assert.Equal(expected, tea.ToString());
}
[Theory]
[InlineData(Size.Small, false, "Small Cowboy Coffee")]
[InlineData(Size.Medium, false, "Medium Cowboy Coffee")]
[InlineData(Size.Large, false, "Large Cowboy Coffee")]
[InlineData(Size.Small, true, "Small Decaf Cowboy Coffee")]
[InlineData(Size.Medium, true, "Medium Decaf Cowboy Coffee")]
[InlineData(Size.Large, true, "Large Decaf Cowboy Coffee")]
public void CowbowyCoffeeToStringShouldMatchExpectations(Size size, bool decaf, string expected)
{
var coffee = new CowboyCoffee()
{
Size = size,
Decaf = decaf
};
Assert.Equal(expected, coffee.ToString());
}
}
}
*/
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using CowboyCafe.Data;
/*
namespace CowboyCafe.DataTests
{
public class WaterTest
{
[Fact]
public void ShouldBeIcedByDefault()
{
var water = new Water();
Assert.True(water.Ice);
}
[Fact]
public void ShouldBeAbleToSetIce()
{
var water = new Water();
water.Ice = false;
Assert.False(water.Ice);
water.Ice = true;
Assert.True(water.Ice);
}
[Fact]
public void ShouldNotHaveLemonByDefault()
{
var water = new Water();
Assert.False(water.Lemon);
}
[Fact]
public void ShouldBeAbleToSetLemon()
{
var water = new Water();
water.Lemon = true;
Assert.True(water.Lemon);
water.Lemon = false;
Assert.False(water.Lemon);
}
[Fact]
public void ShouldBeSmallByDefault()
{
var water = new Water();
Assert.Equal(Size.Small, water.Size);
}
[Fact]
public void ShouldBeAbleToSetSize()
{
var water = new Water();
water.Size = Size.Large;
Assert.Equal(Size.Large, water.Size);
water.Size = Size.Medium;
Assert.Equal(Size.Medium, water.Size);
water.Size = Size.Small;
Assert.Equal(Size.Small, water.Size);
}
[Theory]
[InlineData(Size.Small, 0.12)]
[InlineData(Size.Medium, 0.12)]
[InlineData(Size.Large, 0.12)]
public void ShouldHaveCorrectPriceForSize(Size size, double price)
{
var water = new Water()
{
Size = size
};
Assert.Equal(price, water.Price);
}