コード例 #1
0
        public void InsertAndDeleteTest()
        {
            ProductOptionRepository repo = new ProductOptionRepository();

            Guid id = new Guid();

            ProductOption test = new ProductOption(id, Guid.Parse("8f2e9176-35ee-4f0a-ae55-83023d2db1a3"), "TestProductOption", "This is a unit test created product option");

            repo.Insert(test);

            ProductOption postInsert = repo.GetByID(id);

            Assert.AreEqual(test.Id, postInsert.Id);
            Assert.AreEqual(test.ProductId, postInsert.ProductId);
            Assert.AreEqual(test.Name, postInsert.Name);
            Assert.AreEqual(test.Description, postInsert.Description);

            repo.Delete(postInsert);

            ProductOption postDelete = repo.GetByID(id);

            Assert.IsNull(postDelete);
        }