예제 #1
0
        public void HaveAnIDisposable()
        {
            // Arrange
            var notifyObject = new TestableViewModelBase();

            // Act
            var interfaceObject = notifyObject as IDisposable;

            // Assert
            Assert.NotNull(interfaceObject);
        }
예제 #2
0
        public void SameThreadCall()
        {
            // Arrange
            var notifyObject = new TestableViewModelBase();

            // Act
            bool isUiThread = notifyObject.IsTestIsUiThread;

            // Assert
            Assert.True(isUiThread);
        }
예제 #3
0
        public void InheritingNotifyObject()
        {
            // Arrange
            var notifyObject = new TestableViewModelBase();

            // Act
            var inheritingObject = notifyObject as NotifyObject;

            // Assert
            Assert.NotNull(inheritingObject);
        }
예제 #4
0
        public void AnotherThreadCall()
        {
            // Arrange
            var notifyObject = new TestableViewModelBase();

            // Act
            bool isUiThread = true;

            System.Threading.Tasks.Task[] tasks = new System.Threading.Tasks.Task[1];
            tasks[0]             = System.Threading.Tasks.Task.Factory.StartNew(
                () => isUiThread = notifyObject.IsTestIsUiThread);
            System.Threading.Tasks.Task.Factory.ContinueWhenAll(tasks, completedTasks => {
                // Assert
                Assert.False(isUiThread);
            });
        }
 void CreateTestableViewModel()
 {
     viewModel = new TestableViewModelBase();
 }
예제 #6
0
 void CreateTestableViewModel()
 {
     viewModel = new TestableViewModelBase();
 }