private TRex.SurveyedSurfaces.SurveyedSurfaces MakeSurveyedSurfacesSet(DateTime date, Guid[] guids = null) { var designUid = Guid.NewGuid(); var ss = new TRex.SurveyedSurfaces.SurveyedSurfaces(); ss.AddSurveyedSurfaceDetails(guids?[0] ?? Guid.NewGuid(), new DesignDescriptor(designUid, "Folder", "FileName"), date, BoundingWorldExtent3D.Full()); ss.AddSurveyedSurfaceDetails(guids?[1] ?? Guid.NewGuid(), new DesignDescriptor(designUid, "Folder", "FileName"), date.AddMinutes(1), BoundingWorldExtent3D.Full()); ss.AddSurveyedSurfaceDetails(guids?[2] ?? Guid.NewGuid(), new DesignDescriptor(designUid, "Folder", "FileName"), date.AddMinutes(2), BoundingWorldExtent3D.Full()); ss.AddSurveyedSurfaceDetails(guids?[3] ?? Guid.NewGuid(), new DesignDescriptor(designUid, "Folder", "FileName"), date.AddMinutes(3), BoundingWorldExtent3D.Full()); ss.AddSurveyedSurfaceDetails(guids?[4] ?? Guid.NewGuid(), new DesignDescriptor(designUid, "Folder", "FileName"), date.AddMinutes(4), BoundingWorldExtent3D.Full()); return(ss); }
public void BinaryReadWrite() { var ss = new TRex.SurveyedSurfaces.SurveyedSurfaces(); ss.AddSurveyedSurfaceDetails(Guid.NewGuid(), new DesignDescriptor(Guid.NewGuid(), "Folder", "FileName"), DateTime.UtcNow, BoundingWorldExtent3D.Full()); TestBinary_ReaderWriterHelper.RoundTripSerialise(ss); }
public void SortChronologically() { var surveyedSurfaceUid1 = Guid.NewGuid(); var surveyedSurfaceUid2 = Guid.NewGuid(); var designUid = Guid.NewGuid(); var ss = new TRex.SurveyedSurfaces.SurveyedSurfaces(); var date = DateTime.UtcNow; ss.AddSurveyedSurfaceDetails(surveyedSurfaceUid1, new DesignDescriptor(designUid, "Folder", "FileName"), date, BoundingWorldExtent3D.Full()); ss.AddSurveyedSurfaceDetails(surveyedSurfaceUid2, new DesignDescriptor(designUid, "Folder", "FileName"), date.AddMinutes(1), BoundingWorldExtent3D.Full()); ss.SortChronologically(true); ss[0].AsAtDate.Should().Be(date.AddMinutes(1)); ss[1].AsAtDate.Should().Be(date); ss.SortChronologically(false); ss[0].AsAtDate.Should().Be(date); ss[1].AsAtDate.Should().Be(date.AddMinutes(1)); }
public void AddSurveyedSurfaceDetails() { var surveyedSurfaceUid = Guid.NewGuid(); var designUid = Guid.NewGuid(); var date = DateTime.UtcNow; var ss = new TRex.SurveyedSurfaces.SurveyedSurfaces(); ss.AddSurveyedSurfaceDetails(surveyedSurfaceUid, new DesignDescriptor(designUid, "Folder", "FileName"), date, BoundingWorldExtent3D.Full()); ss.Count.Should().Be(1); ss[0].Should().BeEquivalentTo(new TRex.SurveyedSurfaces.SurveyedSurface(surveyedSurfaceUid, new DesignDescriptor(designUid, "Folder", "FileName"), date, BoundingWorldExtent3D.Full())); }
public void RemoveSurveyedSurfaceDetails() { var surveyedSurfaceUid = Guid.NewGuid(); var designUid = Guid.NewGuid(); var ss = new TRex.SurveyedSurfaces.SurveyedSurfaces(); ss.AddSurveyedSurfaceDetails(surveyedSurfaceUid, new DesignDescriptor(designUid, "Folder", "FileName"), DateTime.UtcNow, BoundingWorldExtent3D.Full()); ss.Count.Should().Be(1); ss.RemoveSurveyedSurface(surveyedSurfaceUid).Should().BeTrue(); ss.Count.Should().Be(0); }
public void IsSameAs() { var date = DateTime.UtcNow; var guids = Enumerable.Range(0, 5).Select(x => Guid.NewGuid()).ToArray(); var ss = MakeSurveyedSurfacesSet(date, guids); ss.IsSameAs(ss).Should().BeTrue(); var ss2 = MakeSurveyedSurfacesSet(date, guids); ss.IsSameAs(ss2).Should().BeTrue(); var ss3 = MakeSurveyedSurfacesSet(date); ss.IsSameAs(ss3).Should().BeFalse(); var ss4 = new TRex.SurveyedSurfaces.SurveyedSurfaces(); ss4.AddSurveyedSurfaceDetails(Guid.NewGuid(), new DesignDescriptor(Guid.NewGuid(), "Folder", "FileName"), date, BoundingWorldExtent3D.Full()); ss.IsSameAs(ss4).Should().BeFalse(); }