public async Task ShouldGetStatusWhenSyncComplete() { // Arrange Slot starting = Slot.One; Slot current = new Slot(11); Slot highest = new Slot(11); INetworkPeering mockNetworkPeering = Substitute.For <INetworkPeering>(); mockNetworkPeering.HighestPeerSlot.Returns(highest); mockNetworkPeering.SyncStartingSlot.Returns(starting); IStore mockStore = Substitute.For <IStore>(); Root root = new Root(Enumerable.Repeat((byte)0x12, 32).ToArray()); Checkpoint checkpoint = new Checkpoint(Epoch.Zero, root); SignedBeaconBlock signedBlock = new SignedBeaconBlock(new BeaconBlock(current, Root.Zero, Root.Zero, BeaconBlockBody.Zero), BlsSignature.Zero); BeaconState state = TestState.Create(slot: current, finalizedCheckpoint: checkpoint); mockStore.GetHeadAsync().Returns(root); mockStore.GetSignedBlockAsync(root).Returns(signedBlock); mockStore.GetBlockStateAsync(root).Returns(state); mockStore.IsInitialized.Returns(true); mockStore.JustifiedCheckpoint.Returns(checkpoint); IServiceCollection testServiceCollection = TestSystem.BuildTestServiceCollection(useStore: true); testServiceCollection.AddSingleton(mockNetworkPeering); testServiceCollection.AddSingleton(mockStore); testServiceCollection.AddSingleton <IHostEnvironment>(Substitute.For <IHostEnvironment>()); testServiceCollection.AddSingleton <IEth1DataProvider>(Substitute.For <IEth1DataProvider>()); testServiceCollection.AddSingleton <IOperationPool>(Substitute.For <IOperationPool>()); ServiceProvider testServiceProvider = testServiceCollection.BuildServiceProvider(); // Act IBeaconNodeApi beaconNode = testServiceProvider.GetService <IBeaconNodeApi>(); beaconNode.ShouldBeOfType(typeof(BeaconNodeFacade)); ApiResponse <Syncing> syncingResponse = await beaconNode.GetSyncingAsync(CancellationToken.None); Syncing syncing = syncingResponse.Content; // Assert syncing.IsSyncing.ShouldBeFalse(); syncing.SyncStatus !.StartingSlot.ShouldBe(Slot.One); syncing.SyncStatus.CurrentSlot.ShouldBe(new Slot(11)); syncing.SyncStatus.HighestSlot.ShouldBe(new Slot(11)); }