void UpdateSeparationTest(ISerializeWrapper serializer)
        {
            var collection = new CRUDCollection <TestPerson>(new List <TestPerson>());
            var id         = collection.Create(new TestPerson());

            collection.Update(id, record => record.IsChecked = true);
            var graph = collection.Read(id);

            Assert.AreEqual(false, graph.IsChecked);
        }
        void CreateReadTest(ISerializeWrapper serializer)
        {
            const string personName = "Taro Yamada";

            var collection = new CRUDCollection <TestPerson>(new List <TestPerson>());
            var id         = collection.Create(new TestPerson()
            {
                Name = personName
            });

            var graph = collection.Read(id);

            Assert.AreEqual(personName, graph.Name);
        }
        void UpdateTest(ISerializeWrapper serializer)
        {
            const string personName      = "Taro Yamada";
            const string finalPersonName = "Hanako Yamada";

            var collection = new CRUDCollection <TestPerson>(new List <TestPerson>());
            var id         = collection.Create(new TestPerson()
            {
                Name = personName
            });

            collection.Update(id, record => record.Name = finalPersonName);
            var graph = collection.Read(id);

            Assert.AreEqual(finalPersonName, graph.Name);
        }
        void DeleteTest(ISerializeWrapper serializer)
        {
            const string personName      = "Taro Yamada";
            const string finalPersonName = "Hanako Yamada";

            var collection = new CRUDCollection <TestPerson>(new List <TestPerson>());
            var id         = collection.Create(new TestPerson()
            {
                Name = personName
            });

            collection.Create(new TestPerson()
            {
                Name = finalPersonName
            });

            collection.Delete(id);
            var graphs = collection.ReadAll();

            Assert.AreEqual(1, graphs.Count);
            Assert.AreEqual(finalPersonName, graphs.First().Name);
        }
示例#5
0
 void Initialize(ISerializeWrapper serializer)
 {
     this.Data   = new TestData();
     this.People = new CRUDCollection <TestPerson>(this.Data.People);
     this.Teams  = new CRUDCollection <TestTeam>(this.Data.Teams);
 }