public void TestIngredientTypeGetDensity2() { var t = new DatabaseAccessRecipe(); var dbD = new DatabaseAccessDensityInformation(); var breadFlour = new Ingredient("Pillsbury Bread Flour") { ingredientId = 1, typeOfIngredient = "bread flour" }; var expected = 5.4m; var actual = dbD.queryDensityTableRowDensityValueByName(breadFlour); Assert.AreEqual(expected, actual); }
public void TestIngredientTypeGetDensity() { var t = new DatabaseAccessRecipe(); var dbD = new DatabaseAccessDensityInformation(); var cakeFlour = new Ingredient("Softasilk") { ingredientId = 1, typeOfIngredient = "cake flour" }; var expected = 4.5m; var actual = dbD.queryDensityTableRowDensityValueByName(cakeFlour); Assert.AreEqual(expected, actual); }
public void TestQueryDensityTableDensityByName2() { var db = new DatabaseAccess(); var dbDI = new DatabaseAccessDensityInformation(); var softasilkCakeFlour = new Ingredient("Softasilk Cake Flour") { typeOfIngredient = "cake flour" }; db.initializeDatabase(); dbDI.insertDensityTextFileIntoDensityInfoDatabase(); var myIngredientDensityInfo = dbDI.queryDensityTableRowDensityValueByName(softasilkCakeFlour); Assert.AreEqual(4.5m, myIngredientDensityInfo); }
public void TestQueryDensityTableDensityByName() { var db = new DatabaseAccess(); var dbDI = new DatabaseAccessDensityInformation(); var flour = new Ingredient("All Purpose Flour") { density = 5m }; db.initializeDatabase(); dbDI.insertDensityTextFileIntoDensityInfoDatabase(); var myIngredientDensityInfo = dbDI.queryDensityTableRowDensityValueByName(flour); Assert.AreEqual(5m, myIngredientDensityInfo); }
public void TestReturnDensityFromDensityTable2() { var t = new DatabaseAccess(); var dbD = new DatabaseAccessDensityInformation(); var r = new Recipe("bread") { id = 1 }; var i = new Ingredient("Salt") { recipeId = 1, ingredientId = 1, measurement = "1/2 teaspoon", sellingWeight = "48 oz" }; t.initializeDatabase(); t.insertIngredientIntoAllTables(i, r); var expected = 10.72m; var actual = dbD.queryDensityTableRowDensityValueByName(i); Assert.AreEqual(expected, actual); }
public void TestReturnDensityFromDensityTable() { var t = new DatabaseAccess(); var dbD = new DatabaseAccessDensityInformation(); var r = new Recipe("bread") { id = 1 }; var i = new Ingredient("all purpose flour") { recipeId = 1, ingredientId = 1, density = 5m, measurement = "6 cups", sellingWeight = "5 lb" }; t.initializeDatabase(); t.insertIngredientIntoAllTables(i, r); var expected = 5m; var actual = dbD.queryDensityTableRowDensityValueByName(i); Assert.AreEqual(expected, actual); }