コード例 #1
0
ファイル: RepositoryTests.cs プロジェクト: rbell/NeuCMS
        public void AddAtom_SavesAtom()
        {
            _repository.Atoms.AddObject(new ContentElement()
            {
                Content = "This is a test", Name = "TestContent", NameSpace = "TestNamespace"
            });
            _repository.Commit();

            var testAtom =
                (from atom in _repository.Atoms
                 where atom.Name == "TestContent" && atom.NameSpace == "TestNamespace"
                 select atom).FirstOrDefault();

            Assert.That(testAtom, Is.Not.Null);
            Assert.That(testAtom.Content, Is.EqualTo("This is a test"));
        }