コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }