Пример #1
0
        public void IsApprovable_WhenDtoIsNull_ReturnsFalse()
        {
            //Arrange
            var cut = new ApprovalWizardPage();
            var wizardManagerViewModel = Mock.Create<IWizardManagerViewModel>();
            Mock.Arrange(() => wizardManagerViewModel.Parameter).Returns((object)null);
            cut.WizardManager = wizardManagerViewModel;

            //Assert
            Assert.IsFalse(cut.IsApprovable);
        } 
Пример #2
0
        public void IsApprovable_WhenDtoIsApprovable_ReturnsTrue()
        {
            //Arrange
            var cut = new ApprovalWizardPage();
            var wizardManagerViewModel = Mock.Create<IWizardManagerViewModel>();
            var approvable = Mock.Create<BulkOperationDto>();
            var value = Mock.Create<Type>();
            Mock.Arrange(() => value.GetInterface(Arg.AnyString, Arg.AnyBool)).Returns(typeof(IApprovable));
            Mock.Arrange(() => approvable.ItemType).Returns(value);
            Mock.Arrange(() => wizardManagerViewModel.Parameter).Returns(approvable);
            cut.WizardManager = wizardManagerViewModel;

            //Assert
            Assert.IsTrue(cut.IsApprovable);
        }
Пример #3
0
 public void PropertiesTests()
 {
     var cut = new ApprovalWizardPage();
     TestsHelper.TestPublicDeclaredPropertiesGetSet(cut, true);
 }