public void Test_SiteModel_Serialization() { const int expectedSiteModelSerializedStreamSize = 90; var guid = Guid.NewGuid(); var siteModel = new SiteModel(guid, TRex.Storage.Models.StorageMutability.Immutable, 1.23); var stream = siteModel.ToStream(); stream.Length.Should().Be(expectedSiteModelSerializedStreamSize); stream.Position = 0; var siteModel2 = new SiteModel(TRex.Storage.Models.StorageMutability.Immutable); siteModel2.FromStream(stream); siteModel2.ID.Should().Be(siteModel.ID); siteModel2.CellSize.Should().Be(siteModel.Grid.CellSize); siteModel2.Grid.ID.Should().Be(siteModel.Grid.ID); siteModel2.Grid.CellSize.Should().Be(siteModel.Grid.CellSize); siteModel2.CreationDate.Should().Be(siteModel.CreationDate); siteModel2.LastModifiedDate.Should().Be(siteModel.LastModifiedDate); siteModel2.IsTransient.Should().Be(siteModel.IsTransient); siteModel2.SiteModelExtent.Should().BeEquivalentTo(siteModel.SiteModelExtent); }