コード例 #1
0
        public void InsertIntoTravelTest()
        {
            TravelModelContainer ctx = new TravelModelContainer();
            var travel = CreateTravelViewTest();

            ctx.Travels.AddObject(travel);
            int result = ctx.SaveChanges();

            Assert.AreEqual(result, 1);
            ctx.Dispose();
        }
コード例 #2
0
        public void UpdateTravelTest()
        {
            TravelModelContainer ctx = new TravelModelContainer();
            Travel travel            = ctx.Travels.First();

            travel.Place = "New York";
            int result = ctx.SaveChanges();

            Assert.AreEqual(result, 1);
            Travel returnedTravel = this.QueryTravelItemTest(travel.PartitionKey, travel.RowKey);

            Assert.AreEqual(returnedTravel.Place, "New York");
            ctx.Dispose();
        }
コード例 #3
0
        public void DeleteFromTravelTest()
        {
            TravelModelContainer ctx = new TravelModelContainer();
            Travel travel            = ctx.Travels.First();

            ctx.Travels.DeleteObject(travel);
            int result = ctx.SaveChanges();

            Assert.AreEqual(result, 1);
            Travel returnedTravel = this.QueryTravelItemTest(travel.PartitionKey, travel.RowKey, true);

            Assert.IsNull(returnedTravel);
            ctx.Dispose();
        }