public void UpdateChannelShouldChangeExistedChannel() { // Arrange CreateTwoNodesForTests(); CreateChannelForTests(); var newCapacity = 90; _channel.Price = AllConstants.AllPrices.ElementAt(2); _channel.ChannelType = ChannelType.Satellite; _channel.Capacity = newCapacity; // Act _network.UpdateChannel(_channel); var updatedChannel = _network.GetChannel(_channel.FirstNodeId, _channel.SecondNodeId); // Assert Assert.That(updatedChannel.Price, Is.EqualTo(AllConstants.AllPrices.ElementAt(2))); Assert.That(updatedChannel.ChannelType, Is.EqualTo(ChannelType.Satellite)); Assert.That(updatedChannel.ConnectionType, Is.EqualTo(_channel.ConnectionType)); Assert.That(updatedChannel.Capacity, Is.EqualTo(newCapacity)); }
private void UpdateChannels(ChannelDto channelDto) { var newChannel = Mapper.Map <ChannelDto, Channel>(channelDto); _network.UpdateChannel(newChannel); var parents = _uiElements .Select(uiElement => VisualTreeHelper.GetParent(_uiElements.First()) as Panel) .GroupBy(panel => panel) .Select(g => g.Key) .ToArray(); RemoveCreatedElements(); foreach (var parent in parents) { DrawComponents(parent); } }