コード例 #1
0
        public void Add(HistoryEntry he)
        {
            IMysteryJsonConverter js = this.getGlobalObject <IMysteryJsonConverter>();
            string he_json           = js.getJson(he);

            _history.Add(he);
        }
コード例 #2
0
        public void CreateAContentInDbTest()
        {
            Guid guid = Guid.Empty;

            using (WebActionExecutor e = new WebActionExecutor())
            {
                string json = e.executeAction(new CreateAContentInDb <TestContentType>()).json_output;
                IMysteryJsonConverter converter = this.getGlobalObject <IMysteryJsonConverter>();
                guid = converter.readJson <Guid>(json);
            }

            ContentsDatabase db = this.getGlobalObject <ContentsDatabase>();

            Assert.IsNotNull(db.GetContent <TestContentType>(guid));
            Assert.IsTrue(db.ContainsType <TestContentType>());
        }
コード例 #3
0
        public void CreateAContentEditItandDeleteITInDbTest()
        {
            Guid guid = Guid.Empty;

            using (WebActionExecutor e = new WebActionExecutor())
            {
                string json = e.executeAction(new CreateAContentInDb <TestContentType>()).json_output;
                IMysteryJsonConverter converter = this.getGlobalObject <IMysteryJsonConverter>();
                guid = converter.readJson <Guid>(json);
            }
            using (WebActionExecutor e = new WebActionExecutor())
            {
                IContentDispatcher cd = this.getGlobalObject <IContentDispatcher>();
                TestContentType    c  = cd.GetContent <TestContentType>(guid);
                c.a_string = "Carlo";
                e.executeAction(new SaveAContentInDb <TestContentType>(), c);
            }

            Assert.IsTrue(true);
        }