コード例 #1
0
        public void StartReceivingExecuteTest()
        {
            //Arrange
            Mock <IDecode>        decodeMock        = new Mock <IDecode>();
            Mock <IEncodeService> encodeServiceMock = new Mock <IEncodeService>();
            var drop = new Drop {
                Data = new byte[4] {
                    7, 0, 2, 0
                }, SelectedParts = new int[2] {
                    1, 2
                }
            };

            encodeServiceMock.Setup(m => m.Encode()).Returns(drop);
            DecoderViewModel decoderViewModel = new DecoderViewModel(decodeMock.Object, encodeServiceMock.Object);

            //Act
            decoderViewModel.StartReceiving.Execute(null);

            //Assert
            decodeMock.Verify(m => m.Decode(It.IsAny <IList <Entities.Drop> >(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>()), Times.Once());
        }
コード例 #2
0
 public DecoderView()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     BindingContext = new DecoderViewModel();
 }