コード例 #1
0
        public void SaveNewActivity()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);

            var activity = new ActivityDTO();

            activity.Name     = "name";
            activity.Color    = System.Drawing.Color.Aqua.ToColorString();
            activity.Duration = TimeSpan.FromMinutes(90);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                var res = service.SaveActivity(data.Token, activity);
                Assert.Greater(res.CreationDate, DateTime.MinValue);
                Assert.AreNotEqual(Guid.Empty, res.GlobalId);
                activity.CreationDate = res.CreationDate;
                activity.ProfileId    = res.ProfileId;
                Assert.IsFalse(activity.IsModified(res));
            });
            Assert.AreEqual(1, Session.QueryOver <Activity>().RowCount());
        }