-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement deep copy methods for components #620
Conversation
#149 focuses on a special case where deep copy did not work, It would have been simple to fix. Not sure, whether I discovered all components where an individual Any comments and further hints are welcome. |
@axunonb I will try to find some time for a review, but this could take a few days. |
* Migrate NUnit 3.14.0 to 4.2.2 * Add NUnit.Analyzers 4.3.0 * Convert Classic Assert to Constraint Model * Introduce Assert.Multiple to group assertions, ensuring all are evaluated even if some fail. * Simplify test case source return types to IEnumerable without a type argument * Remove unused using directives and added necessary ones. Test logic is left unchanged except for 7 tests in Exception context. Here all try...catch blocks are replaced with `Throws.` assertions.
- Implemented `CopyFrom` method in multiple classes for deep copying. - Removed questions in code and implemented solution - Updated `ICopyable` interface documentation. - Introduced pattern matching for better readability - Added new test methods in `CopyComponentTests` class for deep copying various calendar components. - Fixed broken SerializationTests.AttendeesSerialized() (Corrected attendee names and fixed typos in assertions.) - Refactored `CalendarObjectBase` (should eventually become abstract) - Added `ExcludeFromCodeCoverage` attribute to `CalendarObjectList`. - Updated `Ical.Net.csproj` to latest C# version. Fixes ical-org#149
09f66ff
to
1a8c88e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just minor comments.
The following classes don't have CopyFrom
methods, because they are expected to have all their data stored in the Properties
collection. Did only a very rough check to verify, this actually is the case.
Ical.Net.Calendar
Ical.Net.VTimeZoneInfo
Ical.Net.DataTypes.EncodableDataType
Ical.Net.CalendarComponents.Alarm
Ical.Net.CalendarComponents.CalendarEvent
Ical.Net.CalendarComponents.FreeBusy
Ical.Net.CalendarComponents.Journal
Ical.Net.CalendarComponents.RecurringComponent
Ical.Net.CalendarComponents.Todo
Ical.Net.CalendarComponents.UniqueComponent
Ical.Net.CalendarComponents.VTimeZone
Ical.Net.CalendarComponents.VTimeZone.IntervalRecurrencePattern
* Removed redundant check in `Attachment.cs` `CopyFrom` method. * Updated `Period.cs` and `Trigger.cs` to use `Copy<IDateTime>()` method. * Modified `Alarm` class to implement `IComparable<Alarm>` with `CompareTo` method.
0ebef51
to
469c767
Compare
Quality Gate passedIssues Measures |
CopyFrom
method fromICopyable
interface in multiple classes for deep copying.ICopyable
interface documentation.CopyComponentTests
class for deep copying various calendar components.CalendarObjectBase
(should eventually become abstract)ExcludeFromCodeCoverage
attribute toCalendarObjectList
.Ical.Net.csproj
to latest C# version.Fixes #149