56 references to FakeComponent
Microsoft.AspNetCore.Components.Tests (56)
RenderTreeDiffBuilderTest.cs (56)
65builder.OpenComponent<FakeComponent>(0); 252oldTree.OpenComponent<FakeComponent>(0); 254oldTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "Anything"); 257oldTree.OpenComponent<FakeComponent>(0); 259oldTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "Retained param value"); 267newTree.OpenComponent<FakeComponent>(0); 269newTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "Retained param value"); 290oldTree.OpenComponent<FakeComponent>(0); 292oldTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "Will delete"); 295oldTree.OpenComponent<FakeComponent>(2); 296oldTree.AddComponentParameter(3, nameof(FakeComponent.StringProperty), "Retained param value"); 304newTree.OpenComponent<FakeComponent>(2); 305newTree.AddComponentParameter(3, nameof(FakeComponent.StringProperty), "Retained param value"); 322oldTree.OpenComponent<FakeComponent>(1); 330newTree.OpenComponent<FakeComponent>(0); 334newTree.OpenComponent<FakeComponent>(1); 351oldTree.OpenComponent<FakeComponent>(0); 361newTree.OpenComponent<FakeComponent>(0); 810oldTree.OpenComponent<FakeComponent>(123); 1556newTree.OpenComponent<FakeComponent>(12); // 2: <FakeComponent> 1580AssertFrame.ComponentWithInstance<FakeComponent>(renderBatch.ReferenceFrames.Array[0], 0, null, 12); 1589newTree.OpenComponent<FakeComponent>(0); 1590newTree.AddComponentParameter(1, nameof(FakeComponent.IntProperty), 123); 1591newTree.AddComponentParameter(2, nameof(FakeComponent.StringProperty), "some string"); 1592newTree.AddComponentParameter(3, nameof(FakeComponent.ObjectProperty), testObject); 1597var componentInstance = newTree.GetFrames().AsEnumerable().First().Component as FakeComponent; 1615oldTree.OpenComponent<FakeComponent>(12); // 2: <FakeComponent> 1622newTree.OpenComponent<FakeComponent>(12); // 2: <FakeComponent> 1705oldTree.OpenComponent<FakeComponent>(12); 1706oldTree.AddComponentParameter(13, nameof(FakeComponent.StringProperty), "String will change"); 1707oldTree.AddComponentParameter(14, nameof(FakeComponent.ObjectProperty), objectWillNotChange); 1709newTree.OpenComponent<FakeComponent>(12); 1710newTree.AddComponentParameter(13, nameof(FakeComponent.StringProperty), "String did change"); 1711newTree.AddComponentParameter(14, nameof(FakeComponent.ObjectProperty), objectWillNotChange); 1717var originalComponentInstance = (FakeComponent)oldTree.GetFrames().Array[0].Component; 1721var newComponentInstance = (FakeComponent)oldTree.GetFrames().Array[0].Component; 1908FakeComponent capturedInstance1 = null, capturedInstance2 = null; 1909Action<object> assigner1 = val => { capturedInstance1 = (FakeComponent)val; }; 1910Action<object> assigner2 = val => { capturedInstance2 = (FakeComponent)val; }; 1911newTree.OpenComponent<FakeComponent>(0); 1922Assert.IsType<FakeComponent>(capturedInstance1); 1923Assert.IsType<FakeComponent>(capturedInstance2); 1936AssertFrame.Component<FakeComponent>(frame, 3, 0); 1948FakeComponent capturedInstance = null; 1949Action<object> assigner = val => { capturedInstance = (FakeComponent)val; refWriteCount++; }; 1950oldTree.OpenComponent<FakeComponent>(0); 1953newTree.OpenComponent<FakeComponent>(0); 1962Assert.IsType<FakeComponent>(capturedInstance); 2026oldTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "First param"); 2033oldTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "Second param"); 2042newTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "Second param"); 2049newTree.AddComponentParameter(1, nameof(FakeComponent.StringProperty), "First param modified"); 2198oldTree.OpenComponent<FakeComponent>(0);