Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ public void WithoutCascadedAuthenticationState_WrapsOutputInCascadingAuthenticat
componentInstances,
// This is the hierarchy inside the AuthorizeRouteView, which contains its
// own CascadingAuthenticationState
component => Assert.IsType<CascadingAuthenticationState>(component),
component =>
Assert.IsType<CascadingAuthenticationState>(component),
component => Assert.IsType<CascadingValue<Task<AuthenticationState>>>(component),
component => Assert.IsAssignableFrom<AuthorizeViewCore>(component),
component => Assert.IsType<LayoutView>(component),
Expand Down Expand Up @@ -431,11 +432,13 @@ public void WithCascadedAuthenticationState_DoesNotWrapOutputInCascadingAuthenti
Assert.Collection(
componentInstances,
// This is the externally-supplied cascading value
component => Assert.IsType<CascadingValue<Task<AuthenticationState>>>(component),
component =>
Assert.IsType<CascadingValue<Task<AuthenticationState>>>(component),
component => Assert.IsType<AuthorizeRouteView>(component),
// This is the hierarchy inside the AuthorizeRouteView. It doesn't contain a
// further CascadingAuthenticationState
component => Assert.IsAssignableFrom<AuthorizeViewCore>(component),
component =>
Assert.IsAssignableFrom<AuthorizeViewCore>(component),
component => Assert.IsType<LayoutView>(component),
component => Assert.IsType<TestPageWithNoAuthorization>(component)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ public void HandlesKeyBeingAdded()
Assert.Equal("some key", referenceFrames[edit.ReferenceFrameIndex].ElementKey);
},
// Delete old
edit => AssertEdit(edit, RenderTreeEditType.RemoveFrame, 1)
edit =>
AssertEdit(edit, RenderTreeEditType.RemoveFrame, 1)
);
}

Expand All @@ -598,9 +599,11 @@ public void HandlesKeyBeingRemoved()
Assert.Collection(
result.Edits,
// Insert new
edit => AssertEdit(edit, RenderTreeEditType.RemoveFrame, 0),
edit =>
AssertEdit(edit, RenderTreeEditType.RemoveFrame, 0),
// Delete old
edit => AssertEdit(edit, RenderTreeEditType.PrependFrame, 0)
edit =>
AssertEdit(edit, RenderTreeEditType.PrependFrame, 0)
);
}

Expand Down Expand Up @@ -2228,7 +2231,8 @@ public void RecognizesKeyedElementMoves()
Assert.Collection(
result.Edits,
// First we update the modified descendants in place
entry => AssertEdit(entry, RenderTreeEditType.StepIn, 0),
entry =>
AssertEdit(entry, RenderTreeEditType.StepIn, 0),
entry =>
{
AssertEdit(entry, RenderTreeEditType.UpdateText, 0);
Expand All @@ -2240,7 +2244,8 @@ public void RecognizesKeyedElementMoves()
},
entry => AssertEdit(entry, RenderTreeEditType.StepOut, 0),
// Then we have the permutation list
entry => AssertPermutationListEntry(entry, 0, 2),
entry =>
AssertPermutationListEntry(entry, 0, 2),
entry => AssertPermutationListEntry(entry, 2, 0),
entry => AssertEdit(entry, RenderTreeEditType.PermutationListEnd, 0)
);
Expand Down
12 changes: 8 additions & 4 deletions aspnetcore/src/Components/Web/test/Forms/EditFormTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,25 @@ public async Task AddSSRContentWhenMappingContextPresent()
frame => AssertFrame.Region(frame, 13),
frame => AssertFrame.Element(frame, "form", 12),
// Sets "method" to "post" by default
frame => AssertFrame.Attribute(frame, "method", "post"),
frame =>
AssertFrame.Attribute(frame, "method", "post"),
// Assigns name to the submit event
frame => AssertFrame.Attribute(frame, "onsubmit"),
frame =>
AssertFrame.Attribute(frame, "onsubmit"),
frame => AssertFrame.NamedEvent(frame, "onsubmit", "my-form"),
frame => AssertFrame.Region(frame, 4),
// Adds FormMappingValidator child
frame => AssertFrame.Component<FormMappingValidator>(frame, 2),
frame =>
AssertFrame.Component<FormMappingValidator>(frame, 2),
frame =>
AssertFrame.Attribute(
frame,
nameof(FormMappingValidator.CurrentEditContext),
editContext
),
// Adds AntiforgeryToken child
frame => AssertFrame.Component<AntiforgeryToken>(frame, 1),
frame =>
AssertFrame.Component<AntiforgeryToken>(frame, 1),
frame => AssertFrame.Component<CascadingValue<EditContext>>(frame, 4),
frame => AssertFrame.Attribute(frame, "IsFixed", true),
frame => AssertFrame.Attribute(frame, "Value"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3826,7 +3826,8 @@ public void Create_CombinesAllMetadata_InCorrectOrder()
// Initial metadata from RequestDelegateFactoryOptions.EndpointBuilder. If the caller want to override inferred metadata,
// They need to call InferMetadata first, then add the overriding metadata, and then call Create with InferMetadata's result.
// This is demonstrated in the following tests.
m => Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Caller }),
m =>
Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Caller }),
// Inferred AcceptsMetadata from RDF for complex type
m =>
Assert.True(
Expand All @@ -3839,11 +3840,14 @@ public void Create_CombinesAllMetadata_InCorrectOrder()
((IProducesResponseTypeMetadata)m).Type
),
// Metadata provided by parameters implementing IEndpointParameterMetadataProvider
m => Assert.True(m is ParameterNameMetadata { Name: "param1" }),
m =>
Assert.True(m is ParameterNameMetadata { Name: "param1" }),
// Metadata provided by parameters implementing IEndpointMetadataProvider
m => Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Parameter }),
m =>
Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Parameter }),
// Metadata provided by return type implementing IEndpointMetadataProvider
m => Assert.True(m is MetadataCountMetadata { Count: 5 })
m =>
Assert.True(m is MetadataCountMetadata { Count: 5 })
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ public async Task MapAction_ChangeReturnType_TriggersUpdate()
Assert.Collection(
outputSteps,
// First source output for diagnostics is unchanged.
step => Assert.Equal(IncrementalStepRunReason.Unchanged, step.Reason),
step =>
Assert.Equal(IncrementalStepRunReason.Unchanged, step.Reason),
// Second source output for generated code is changed.
step => Assert.Equal(IncrementalStepRunReason.Modified, step.Reason)
step =>
Assert.Equal(IncrementalStepRunReason.Modified, step.Reason)
);
}

Expand All @@ -75,9 +77,11 @@ public async Task MapAction_ChangeBodyParamNullability_TriggersUpdate_ForSourceO
Assert.Collection(
outputSteps,
// First source output for diagnostics is unchanged.
step => Assert.Equal(IncrementalStepRunReason.Unchanged, step.Reason),
step =>
Assert.Equal(IncrementalStepRunReason.Unchanged, step.Reason),
// Second source output for generated code is changed.
step => Assert.Equal(IncrementalStepRunReason.Modified, step.Reason)
step =>
Assert.Equal(IncrementalStepRunReason.Modified, step.Reason)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,17 @@ m is IAcceptsMetadata am
((IProducesResponseTypeMetadata)m).Type
),
// Metadata provided by parameters implementing IEndpointParameterMetadataProvider
m => Assert.True(m is ParameterNameMetadata { Name: "param1" }),
m =>
Assert.True(m is ParameterNameMetadata { Name: "param1" }),
// Metadata provided by parameters implementing IEndpointMetadataProvider
m => Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Parameter }),
m =>
Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Parameter }),
// Metadata provided by return type implementing IEndpointMetadataProvider
m => Assert.True(m is MetadataCountMetadata),
m =>
Assert.True(m is MetadataCountMetadata),
// Entry-specific metadata added after a call to InferMetadata
m => Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Caller })
m =>
Assert.True(m is CustomEndpointMetadata { Source: MetadataSource.Caller })
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ public virtual InternalServiceCollectionMap DoPatchInjection<TService>()
var injectedDescriptor = new ServiceDescriptor(
typeof(TService),
// TODO: What should we do here? Can annotate InjectServices to accept null, but then it has to return it too...
p => InjectServices(p, descriptor.ImplementationInstance!),
p =>
InjectServices(p, descriptor.ImplementationInstance!),
lifetime
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ public virtual Task Update_with_interface_in_EF_Property_in_property_expression(
ss => ss.Set<Coke>(),
e => e,
// ReSharper disable once RedundantCast
s => s.SetProperty(c => EF.Property<int>((ISugary)c, nameof(ISugary.SugarGrams)), 0),
s =>
s.SetProperty(c => EF.Property<int>((ISugary)c, nameof(ISugary.SugarGrams)), 0),
rowsAffectedCount: 1
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,8 @@ bool async
AssertQuery(
async,
// ReSharper disable once RedundantTernaryExpression
ss => ss.Set<CogTag>().Where(t => t.Gear.HasSoulPatch ? true : false)
ss =>
ss.Set<CogTag>().Where(t => t.Gear.HasSoulPatch ? true : false)
);

[ConditionalTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public virtual Task Can_use_backwards_is_animal(bool async) =>
async,
// ReSharper disable once IsExpressionAlwaysTrue
// ReSharper disable once ConvertTypeCheckToNullCheck
ss => ss.Set<Kiwi>().Where(a => a is Animal)
ss =>
ss.Set<Kiwi>().Where(a => a is Animal)
);

[ConditionalTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ public virtual Task Where_First(bool async) =>
AssertFirst(
async,
// ReSharper disable once ReplaceWithSingleCallToFirst
ss => ss.Set<Customer>().OrderBy(c => c.ContactName).Where(c => c.City == "London")
ss =>
ss.Set<Customer>().OrderBy(c => c.ContactName).Where(c => c.City == "London")
);

[ConditionalTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,8 @@ public virtual Task Where_compare_with_both_cast_to_object(bool async) =>
AssertQuery(
async,
// ReSharper disable twice RedundantCast
ss => ss.Set<Customer>().Where(c => (object)c.City == (object)"London")
ss =>
ss.Set<Customer>().Where(c => (object)c.City == (object)"London")
);

[ConditionalTheory]
Expand All @@ -1657,7 +1658,8 @@ public virtual Task Where_Is_on_same_type(bool async) =>
AssertQuery(
async,
// ReSharper disable once ConvertTypeCheckToNullCheck
ss => ss.Set<Customer>().Where(c => c is Customer)
ss =>
ss.Set<Customer>().Where(c => c is Customer)
);

[ConditionalTheory]
Expand Down Expand Up @@ -1810,7 +1812,8 @@ public virtual Task Where_is_conditional(bool async) =>
async,
// ReSharper disable once ConvertTypeCheckToNullCheck
// ReSharper disable once SimplifyConditionalTernaryExpression
ss => ss.Set<Product>().Where(p => p is Product ? false : true),
ss =>
ss.Set<Product>().Where(p => p is Product ? false : true),
assertEmpty: true
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public virtual Task Inline_collection_Contains_with_zero_values(bool async) =>
AssertQuery(
async,
// ReSharper disable once UseArrayEmptyMethod
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c => new int[0].Contains(c.Id)),
ss =>
ss.Set<PrimitiveCollectionsEntity>().Where(c => new int[0].Contains(c.Id)),
assertEmpty: true
);

Expand Down Expand Up @@ -418,7 +419,8 @@ public virtual Task Column_collection_Count_method(bool async) =>
AssertQuery(
async,
// ReSharper disable once UseCollectionCountProperty
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c => c.Ints.Count() == 2)
ss =>
ss.Set<PrimitiveCollectionsEntity>().Where(c => c.Ints.Count() == 2)
);

[ConditionalTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ CancellationToken cancellationToken
// if initializer was null we wouldn't have found expressions
// any constructed nodes (default/null) should give -1 because parent is null
expression =>
objectCreationExpression.Initializer!.Expressions.IndexOf(expression.Parent)
objectCreationExpression.Initializer!.Expressions.IndexOf(
expression.Parent
)
);

documentEditor.ReplaceNode(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ SyntaxListBuilder<XmlAttributeSyntax> attrs
ref elementName,
attrs,
// not expected condition
p => p.CurrentToken.Kind != SyntaxKind.IdentifierName,
p =>
p.CurrentToken.Kind != SyntaxKind.IdentifierName,
// abort condition (looks like something we might understand later)
p =>
p.CurrentToken.Kind == SyntaxKind.GreaterThanToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ private static Func<string, T> GetParser(string type) =>
// Try to map a boolean value. Either map it to true/false if we're a
// CodeStyleOption<bool> or map it to the 0 or 1 value for an enum if we're
// a CodeStyleOption<SomeEnumType>.
v => Convert(bool.Parse(v)),
v =>
Convert(bool.Parse(v)),
nameof(Int32) => v => Convert(int.Parse(v)),
nameof(String) => v => (T)(object)v,
_ => throw new ArgumentException(nameof(type)),
Expand Down
Loading