00001
00002 using System;
00003 using NUnit.Framework;
00004 using Foodolini.Database;
00005
00006 namespace Foodolini.Database.Test
00007 {
00011 [TestFixture]
00012 public class FoodGroupTest : DatabaseTest
00013 {
00014
00019 [Test]
00020 public void SaveLoad()
00021 {
00022 FoodGroup foodGroup = new FoodGroup();
00023 foodGroup.FoodGroupId = 1;
00024 foodGroup.Description= "Morgenmad";
00025
00026
00027
00028
00029 this.repository.Add<FoodGroup>(foodGroup);
00030
00031 Assert.AreNotEqual(0, foodGroup.FoodGroupId, "Test that a foodgroup has been given a database ID");
00032
00033 Assert.AreSame("Morgenmad", foodGroup.Description, "Test that the description of the added foodgroup match.");
00034
00035 Assert.AreEqual(1, foodGroup.FoodGroupId, "Test that the ID of the foodGroup match");
00036
00037
00038 }
00039 }
00040 }