Ejemplo n.º 1
0
        public void CreateNew()
        {
            var testClass = new EmptyClass();
            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());

            testClass = Modl<EmptyClass>.New();
            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());

            var id = Guid.NewGuid();
            testClass = Modl<EmptyClass>.New(id);
            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());
            Assert.True(id == testClass.Id());
        }
Ejemplo n.º 2
0
        public void SetId()
        {
            var id        = Guid.NewGuid();
            var testClass = new EmptyClass();

            testClass.Id(id);
            Assert.Equal(id, testClass.Id().Get());
            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());
        }
Ejemplo n.º 3
0
        public void CreateNew()
        {
            var testClass = new EmptyClass();

            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());

            testClass = Modl <EmptyClass> .New();

            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());

            var id = Guid.NewGuid();

            testClass = Modl <EmptyClass> .New(id);

            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());
            Assert.True(id == testClass.Id());
        }
Ejemplo n.º 4
0
        public void Save()
        {
            var testClass = new EmptyClass();
            var id        = testClass.Id();

            testClass.Save();
            Assert.False(testClass.IsNew());
            Assert.False(testClass.IsModified());
            Assert.Equal(id, testClass.Id());

            var loadedTestClass = Modl <EmptyClass> .Get(id);

            Assert.Equal(id, loadedTestClass.Id());
            Assert.False(loadedTestClass.IsNew());
            Assert.False(loadedTestClass.IsModified());
        }
Ejemplo n.º 5
0
        public void GenerateId()
        {
            var testClass = new EmptyClass();
            var id = testClass.Id().Get();
            Assert.NotNull(id);
            Assert.True(id is Guid);
            Assert.NotEqual(Guid.Empty, id);

            //testClass.Id().Generate();
            Assert.NotEqual(id, testClass.Id());
            Assert.NotNull(testClass.Id());
            Assert.True(testClass.Id().Get() is Guid);
            Assert.False(Guid.Empty == testClass.Id());

            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());
        }
Ejemplo n.º 6
0
        public void GenerateId()
        {
            var testClass = new EmptyClass();
            var id        = testClass.Id().Get();

            Assert.NotNull(id);
            Assert.True(id is Guid);
            Assert.NotEqual(Guid.Empty, id);

            //testClass.Id().Generate();
            Assert.NotEqual(id, testClass.Id());
            Assert.NotNull(testClass.Id());
            Assert.True(testClass.Id().Get() is Guid);
            Assert.False(Guid.Empty == testClass.Id());

            Assert.True(testClass.IsNew());
            Assert.False(testClass.IsModified());
        }
Ejemplo n.º 7
0
 public void SetId()
 {
     var id = Guid.NewGuid();
     var testClass = new EmptyClass();
     testClass.Id(id);
     Assert.Equal(id, testClass.Id().Get());
     Assert.True(testClass.IsNew());
     Assert.False(testClass.IsModified());
 }
Ejemplo n.º 8
0
        public void Save()
        {
            var testClass = new EmptyClass();
            var id = testClass.Id();
            testClass.Save();
            Assert.False(testClass.IsNew());
            Assert.False(testClass.IsModified());
            Assert.Equal(id, testClass.Id());

            var loadedTestClass = Modl<EmptyClass>.Get(id);
            Assert.Equal(id, loadedTestClass.Id());
            Assert.False(loadedTestClass.IsNew());
            Assert.False(loadedTestClass.IsModified());
        }