Dreamine.FullKit.Wpf.Tests 1.0.0.0
Dreamine.FullKit.Wpf.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.FullKit.Wpf.Tests.Communication.CommunicationWpfTests 클래스 참조sealed

더 자세히 ...

Public 멤버 함수

void DelegateCommand_ExecutesAndRaisesCanExecuteChanged ()
void ConnectionStateBrushConverter_MapsStatesToBrushes ()
void CommunicationChannelViewItem_RaisesPropertyChangedForChangedValuesOnly ()
void CommunicationMessageLogItem_StoresDisplayValues ()

상세한 설명

Communication Wpf Tests 기능과 관련 상태를 캡슐화합니다.

CommunicationWpfTests.cs 파일의 19 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ CommunicationChannelViewItem_RaisesPropertyChangedForChangedValuesOnly()

void Dreamine.FullKit.Wpf.Tests.Communication.CommunicationWpfTests.CommunicationChannelViewItem_RaisesPropertyChangedForChangedValuesOnly ( )
inline

Communication Channel View Item Raises Property Changed For Changed Values Only 작업을 수행합니다.

CommunicationWpfTests.cs 파일의 77 번째 라인에서 정의되었습니다.

78 {
79 var item = new CommunicationChannelViewItem();
80 var changed = new List<string?>();
81 item.PropertyChanged += (_, args) => changed.Add(args.PropertyName);
82
83 item.Name = "Main";
84 item.Name = "Main";
85 item.State = ConnectionState.Connected;
86
87 Assert.Equal(new[] { "Name", "State" }, changed);
88 }

◆ CommunicationMessageLogItem_StoresDisplayValues()

void Dreamine.FullKit.Wpf.Tests.Communication.CommunicationWpfTests.CommunicationMessageLogItem_StoresDisplayValues ( )
inline

Communication Message Log Item Stores Display Values 작업을 수행합니다.

CommunicationWpfTests.cs 파일의 99 번째 라인에서 정의되었습니다.

100 {
101 var item = new CommunicationMessageLogItem
102 {
103 ChannelName = "Socket",
104 Kind = TransportKind.Tcp,
105 Direction = "TX",
106 MessageName = "Ping",
107 Route = "route",
108 PayloadLength = 3,
109 PayloadPreview = "abc"
110 };
111
112 Assert.Equal("Socket", item.ChannelName);
113 Assert.Equal(TransportKind.Tcp, item.Kind);
114 Assert.Equal("abc", item.PayloadPreview);
115 }

◆ ConnectionStateBrushConverter_MapsStatesToBrushes()

void Dreamine.FullKit.Wpf.Tests.Communication.CommunicationWpfTests.ConnectionStateBrushConverter_MapsStatesToBrushes ( )
inline

Connection State Brush Converter Maps States To Brushes 작업을 수행합니다.

CommunicationWpfTests.cs 파일의 57 번째 라인에서 정의되었습니다.

58 {
59 var converter = new ConnectionStateBrushConverter();
60
61 Assert.Same(Brushes.ForestGreen, converter.Convert(ConnectionState.Connected, typeof(Brush), null!, CultureInfo.InvariantCulture));
62 Assert.Same(Brushes.DarkOrange, converter.Convert(ConnectionState.Connecting, typeof(Brush), null!, CultureInfo.InvariantCulture));
63 Assert.Same(Brushes.Firebrick, converter.Convert(ConnectionState.Faulted, typeof(Brush), null!, CultureInfo.InvariantCulture));
64 Assert.Same(Brushes.Gray, converter.Convert("bad", typeof(Brush), null!, CultureInfo.InvariantCulture));
65 Assert.Same(Binding.DoNothing, converter.ConvertBack(Brushes.Gray, typeof(ConnectionState), null!, CultureInfo.InvariantCulture));
66 }

◆ DelegateCommand_ExecutesAndRaisesCanExecuteChanged()

void Dreamine.FullKit.Wpf.Tests.Communication.CommunicationWpfTests.DelegateCommand_ExecutesAndRaisesCanExecuteChanged ( )
inline

Delegate Command Executes And Raises Can Execute Changed 작업을 수행합니다.

CommunicationWpfTests.cs 파일의 30 번째 라인에서 정의되었습니다.

31 {
32 var executedParameter = "";
33 var raised = false;
34 var command = new DelegateCommand(
35 parameter => executedParameter = (string)parameter!,
36 parameter => (string)parameter! == "ok");
37 command.CanExecuteChanged += (_, _) => raised = true;
38
39 command.Execute("ok");
40 command.RaiseCanExecuteChanged();
41
42 Assert.True(command.CanExecute("ok"));
43 Assert.False(command.CanExecute("no"));
44 Assert.Equal("ok", executedParameter);
45 Assert.True(raised);
46 }

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: