Example #1
0
        public void Test_SiteModel_Creation_WithNonTransientOriginModel_NothingPreserved()
        {
            var guid                    = Guid.NewGuid();
            var originSiteModel         = new SiteModel(guid, TRex.Storage.Models.StorageMutability.Immutable, false);
            var originModelModifiedDate = originSiteModel.LastModifiedDate;
            var originModelCreationDate = originSiteModel.CreationDate;

            var newSiteModel = new SiteModel(originSiteModel, SiteModelOriginConstructionFlags.PreserveNothing);

            newSiteModel.Should().NotBe(originSiteModel);
            newSiteModel.ID.Should().Be(guid);
            newSiteModel.IsTransient.Should().Be(false);
            newSiteModel.LastModifiedDate.Should().Be(originModelModifiedDate);
            newSiteModel.CreationDate.Should().Be(originModelCreationDate);
            newSiteModel.CellSize.Should().Be(originSiteModel.Grid.CellSize);

            newSiteModel.Grid.Should().NotBe(originSiteModel.Grid);
            newSiteModel.Grid.CellSize.Should().Be(originSiteModel.Grid.CellSize);
        }