コード例 #1
0
        public TrackableTestContainerWithIgnore Clone()
        {
            var o = new TrackableTestContainerWithIgnore();

            o._Person   = _Person?.Clone();
            o._Missions = _Missions?.Clone();
            return(o);
        }
コード例 #2
0
        public async Task Test_CreateAndLoad_CheckIgnored()
        {
            var id = 1;
            var c0 = new TrackableTestContainerWithIgnore();

            c0.Person.Name = "Testor";
            c0.Person.Age  = 10;
            c0.Missions[1] = new MissionData {
                Kind = 101, Count = 20, Note = "Ignored"
            };
            await _mapper.CreateAsync(_db.Connection, c0, id);

            var c1 = await _mapper.LoadAsync(_db.Connection, id);

            Assert.NotNull(c1.Person);
            Assert.Equal(c0.Person.Name, c1.Person.Name);
            Assert.Equal(c0.Person.Age, c1.Person.Age);
            Assert.Equal(0, c1.Missions.Count);
        }