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()); }
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()); }
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()); }
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()); }
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()); }
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()); }