Skip to content

Commit

Permalink
Regenerate integration test files
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Nov 20, 2023
1 parent d259502 commit 6bcbba0
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public static partial class CircularReferenceMapper
return existingTargetReference;
var target = new global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto();
refHandler.SetReference<global::Riok.Mapperly.IntegrationTests.Models.CircularReferenceObject, global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto>(source, target);
if (source.Parent != null)
if (source.Parent is { } sourceParent)
{
target.Parent = MapToCircularReferenceDto(source.Parent, refHandler);
target.Parent = MapToCircularReferenceDto(sourceParent, refHandler);
}
target.Value = source.Value;
return target;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ public static partial class DeepCloningMapper
IntInitOnlyValue = src.IntInitOnlyValue,
RequiredValue = src.RequiredValue,
};
if (src.NullableFlattening != null)
if (src.NullableFlattening is { } srcNullableFlattening)
{
target.NullableFlattening = Copy(src.NullableFlattening);
target.NullableFlattening = Copy(srcNullableFlattening);
}
if (src.NestedNullable != null)
if (src.NestedNullable is { } srcNestedNullable)
{
target.NestedNullable = MapToTestObjectNested(src.NestedNullable);
target.NestedNullable = MapToTestObjectNested(srcNestedNullable);
}
if (src.NestedNullableTargetNotNullable != null)
if (src.NestedNullableTargetNotNullable is { } srcNestedNullableTargetNotNullable)
{
target.NestedNullableTargetNotNullable = MapToTestObjectNested(src.NestedNullableTargetNotNullable);
target.NestedNullableTargetNotNullable = MapToTestObjectNested(srcNestedNullableTargetNotNullable);
}
if (src.TupleValue != null)
if (src.TupleValue is { } srcTupleValue)
{
target.TupleValue = MapToValueTuple(src.TupleValue.Value);
target.TupleValue = MapToValueTuple(srcTupleValue);
}
if (src.RecursiveObject != null)
if (src.RecursiveObject is { } srcRecursiveObject)
{
target.RecursiveObject = Copy(src.RecursiveObject);
target.RecursiveObject = Copy(srcRecursiveObject);
}
if (src.SourceTargetSameObjectType != null)
if (src.SourceTargetSameObjectType is { } srcSourceTargetSameObjectType)
{
target.SourceTargetSameObjectType = Copy(src.SourceTargetSameObjectType);
target.SourceTargetSameObjectType = Copy(srcSourceTargetSameObjectType);
}
if (src.NullableReadOnlyObjectCollection != null)
if (src.NullableReadOnlyObjectCollection is { } srcNullableReadOnlyObjectCollection)
{
target.NullableReadOnlyObjectCollection = MapToIReadOnlyCollection(src.NullableReadOnlyObjectCollection);
target.NullableReadOnlyObjectCollection = MapToIReadOnlyCollection(srcNullableReadOnlyObjectCollection);
}
if (src.SubObject != null)
if (src.SubObject is { } srcSubObject)
{
target.SubObject = MapToInheritanceSubObject(src.SubObject);
target.SubObject = MapToInheritanceSubObject(srcSubObject);
}
target.IntValue = src.IntValue;
target.StringValue = src.StringValue;
Expand Down Expand Up @@ -133,4 +133,4 @@ private static (string A, string) MapToValueTuple((string A, string) source)
return target;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,43 +51,43 @@ public partial int ParseableInt(string value)
IntInitOnlyValue = DirectInt(testObject.IntInitOnlyValue),
RequiredValue = DirectInt(testObject.RequiredValue),
};
if (testObject.NullableFlattening != null)
if (testObject.NullableFlattening is { } testObjectNullableFlattening)
{
target.NullableFlatteningIdValue = CastIntNullable(testObject.NullableFlattening.IdValue);
target.NullableFlatteningIdValue = CastIntNullable(testObjectNullableFlattening.IdValue);
}
if (testObject.NullableUnflatteningIdValue != null)
if (testObject.NullableUnflatteningIdValue is { } testObjectNullableUnflatteningIdValue)
{
target.NullableUnflattening ??= new();
target.NullableUnflattening.IdValue = DirectInt(testObject.NullableUnflatteningIdValue.Value);
target.NullableUnflattening.IdValue = DirectInt(testObjectNullableUnflatteningIdValue);
}
if (testObject.NestedNullable != null)
if (testObject.NestedNullable is { } testObjectNestedNullable)
{
target.NestedNullableIntValue = DirectInt(testObject.NestedNullable.IntValue);
target.NestedNullable = MapToTestObjectNestedDto(testObject.NestedNullable);
target.NestedNullableIntValue = DirectInt(testObjectNestedNullable.IntValue);
target.NestedNullable = MapToTestObjectNestedDto(testObjectNestedNullable);
}
if (testObject.NestedNullableTargetNotNullable != null)
if (testObject.NestedNullableTargetNotNullable is { } testObjectNestedNullableTargetNotNullable)
{
target.NestedNullableTargetNotNullable = MapToTestObjectNestedDto(testObject.NestedNullableTargetNotNullable);
target.NestedNullableTargetNotNullable = MapToTestObjectNestedDto(testObjectNestedNullableTargetNotNullable);
}
if (testObject.StringNullableTargetNotNullable != null)
if (testObject.StringNullableTargetNotNullable is { } testObjectStringNullableTargetNotNullable)
{
target.StringNullableTargetNotNullable = testObject.StringNullableTargetNotNullable;
target.StringNullableTargetNotNullable = testObjectStringNullableTargetNotNullable;
}
if (testObject.TupleValue != null)
if (testObject.TupleValue is { } testObjectTupleValue)
{
target.TupleValue = MapToValueTuple(testObject.TupleValue.Value);
target.TupleValue = MapToValueTuple(testObjectTupleValue);
}
if (testObject.RecursiveObject != null)
if (testObject.RecursiveObject is { } testObjectRecursiveObject)
{
target.RecursiveObject = MapToDto(testObject.RecursiveObject);
target.RecursiveObject = MapToDto(testObjectRecursiveObject);
}
if (testObject.NullableReadOnlyObjectCollection != null)
if (testObject.NullableReadOnlyObjectCollection is { } testObjectNullableReadOnlyObjectCollection)
{
target.NullableReadOnlyObjectCollection = MapToTestObjectNestedDtoArray(testObject.NullableReadOnlyObjectCollection);
target.NullableReadOnlyObjectCollection = MapToTestObjectNestedDtoArray(testObjectNullableReadOnlyObjectCollection);
}
if (testObject.SubObject != null)
if (testObject.SubObject is { } testObjectSubObject)
{
target.SubObject = MapToInheritanceSubObjectDto(testObject.SubObject);
target.SubObject = MapToInheritanceSubObjectDto(testObjectSubObject);
}
target.IntValue = DirectInt(testObject.IntValue);
target.StringValue = testObject.StringValue;
Expand Down Expand Up @@ -148,29 +148,29 @@ public partial int ParseableInt(string value)
IntInitOnlyValue = DirectInt(dto.IntInitOnlyValue),
RequiredValue = DirectInt(dto.RequiredValue),
};
if (dto.NullableUnflattening != null)
if (dto.NullableUnflattening is { } dtoNullableUnflattening)
{
target.NullableUnflatteningIdValue = CastIntNullable(dto.NullableUnflattening.IdValue);
target.NullableUnflatteningIdValue = CastIntNullable(dtoNullableUnflattening.IdValue);
}
if (dto.NestedNullable != null)
if (dto.NestedNullable is { } dtoNestedNullable)
{
target.NestedNullable = MapToTestObjectNested(dto.NestedNullable);
target.NestedNullable = MapToTestObjectNested(dtoNestedNullable);
}
if (dto.TupleValue != null)
if (dto.TupleValue is { } dtoTupleValue)
{
target.TupleValue = MapToValueTuple1(dto.TupleValue.Value);
target.TupleValue = MapToValueTuple1(dtoTupleValue);
}
if (dto.RecursiveObject != null)
if (dto.RecursiveObject is { } dtoRecursiveObject)
{
target.RecursiveObject = MapFromDto(dto.RecursiveObject);
target.RecursiveObject = MapFromDto(dtoRecursiveObject);
}
if (dto.NullableReadOnlyObjectCollection != null)
if (dto.NullableReadOnlyObjectCollection is { } dtoNullableReadOnlyObjectCollection)
{
target.NullableReadOnlyObjectCollection = MapToIReadOnlyCollection(dto.NullableReadOnlyObjectCollection);
target.NullableReadOnlyObjectCollection = MapToIReadOnlyCollection(dtoNullableReadOnlyObjectCollection);
}
if (dto.SubObject != null)
if (dto.SubObject is { } dtoSubObject)
{
target.SubObject = MapToInheritanceSubObject(dto.SubObject);
target.SubObject = MapToInheritanceSubObject(dtoSubObject);
}
target.IntValue = DirectInt(dto.IntValue);
target.StringValue = dto.StringValue;
Expand Down Expand Up @@ -223,38 +223,38 @@ public partial int ParseableInt(string value)

public partial void UpdateDto(global::Riok.Mapperly.IntegrationTests.Models.TestObject source, global::Riok.Mapperly.IntegrationTests.Dto.TestObjectDto target)
{
if (source.NullableFlattening != null)
if (source.NullableFlattening is { } sourceNullableFlattening)
{
target.NullableFlatteningIdValue = CastIntNullable(source.NullableFlattening.IdValue);
target.NullableFlatteningIdValue = CastIntNullable(sourceNullableFlattening.IdValue);
}
if (source.NestedNullable != null)
if (source.NestedNullable is { } sourceNestedNullable)
{
target.NestedNullableIntValue = DirectInt(source.NestedNullable.IntValue);
target.NestedNullable = MapToTestObjectNestedDto(source.NestedNullable);
target.NestedNullableIntValue = DirectInt(sourceNestedNullable.IntValue);
target.NestedNullable = MapToTestObjectNestedDto(sourceNestedNullable);
}
if (source.NestedNullableTargetNotNullable != null)
if (source.NestedNullableTargetNotNullable is { } sourceNestedNullableTargetNotNullable)
{
target.NestedNullableTargetNotNullable = MapToTestObjectNestedDto(source.NestedNullableTargetNotNullable);
target.NestedNullableTargetNotNullable = MapToTestObjectNestedDto(sourceNestedNullableTargetNotNullable);
}
if (source.StringNullableTargetNotNullable != null)
if (source.StringNullableTargetNotNullable is { } sourceStringNullableTargetNotNullable)
{
target.StringNullableTargetNotNullable = source.StringNullableTargetNotNullable;
target.StringNullableTargetNotNullable = sourceStringNullableTargetNotNullable;
}
if (source.TupleValue != null)
if (source.TupleValue is { } sourceTupleValue)
{
target.TupleValue = MapToValueTuple(source.TupleValue.Value);
target.TupleValue = MapToValueTuple(sourceTupleValue);
}
if (source.RecursiveObject != null)
if (source.RecursiveObject is { } sourceRecursiveObject)
{
target.RecursiveObject = MapToDto(source.RecursiveObject);
target.RecursiveObject = MapToDto(sourceRecursiveObject);
}
if (source.NullableReadOnlyObjectCollection != null)
if (source.NullableReadOnlyObjectCollection is { } sourceNullableReadOnlyObjectCollection)
{
target.NullableReadOnlyObjectCollection = MapToTestObjectNestedDtoArray(source.NullableReadOnlyObjectCollection);
target.NullableReadOnlyObjectCollection = MapToTestObjectNestedDtoArray(sourceNullableReadOnlyObjectCollection);
}
if (source.SubObject != null)
if (source.SubObject is { } sourceSubObject)
{
target.SubObject = MapToInheritanceSubObjectDto(source.SubObject);
target.SubObject = MapToInheritanceSubObjectDto(sourceSubObject);
}
target.CtorValue = DirectInt(source.CtorValue);
target.CtorValue2 = DirectInt(source.CtorValue2);
Expand Down Expand Up @@ -482,4 +482,4 @@ static file class UnsafeAccessor
[global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_PrivateValue")]
public static extern void SetPrivateValue1(this global::Riok.Mapperly.IntegrationTests.Models.TestObject target, int value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,26 @@ public static partial class ProjectionMapper
IntInitOnlyValue = testObject.IntInitOnlyValue,
RequiredValue = testObject.RequiredValue,
};
if (testObject.NestedNullable != null)
if (testObject.NestedNullable is { } testObjectNestedNullable)
{
target.NestedNullableIntValue = testObject.NestedNullable.IntValue;
target.NestedNullable = MapToTestObjectNestedDto(testObject.NestedNullable);
target.NestedNullableIntValue = testObjectNestedNullable.IntValue;
target.NestedNullable = MapToTestObjectNestedDto(testObjectNestedNullable);
}
if (testObject.NestedNullableTargetNotNullable != null)
if (testObject.NestedNullableTargetNotNullable is { } testObjectNestedNullableTargetNotNullable)
{
target.NestedNullableTargetNotNullable = MapToTestObjectNestedDto(testObject.NestedNullableTargetNotNullable);
target.NestedNullableTargetNotNullable = MapToTestObjectNestedDto(testObjectNestedNullableTargetNotNullable);
}
if (testObject.StringNullableTargetNotNullable != null)
if (testObject.StringNullableTargetNotNullable is { } testObjectStringNullableTargetNotNullable)
{
target.StringNullableTargetNotNullable = testObject.StringNullableTargetNotNullable;
target.StringNullableTargetNotNullable = testObjectStringNullableTargetNotNullable;
}
if (testObject.NullableReadOnlyObjectCollection != null)
if (testObject.NullableReadOnlyObjectCollection is { } testObjectNullableReadOnlyObjectCollection)
{
target.NullableReadOnlyObjectCollection = MapToIReadOnlyCollection(testObject.NullableReadOnlyObjectCollection);
target.NullableReadOnlyObjectCollection = MapToIReadOnlyCollection(testObjectNullableReadOnlyObjectCollection);
}
if (testObject.SubObject != null)
if (testObject.SubObject is { } testObjectSubObject)
{
target.SubObject = MapToInheritanceSubObjectDto(testObject.SubObject);
target.SubObject = MapToInheritanceSubObjectDto(testObjectSubObject);
}
target.IntValue = testObject.IntValue;
target.StringValue = testObject.StringValue;
Expand Down Expand Up @@ -199,4 +199,4 @@ private static string MapToString(global::Riok.Mapperly.IntegrationTests.Models.
return target;
}
}
}
}
Loading

0 comments on commit 6bcbba0

Please sign in to comment.