Esempio n. 1
0
        public void AdvancedRecordsetActivityWorker_AddDeclarations_ExpectedException_NoThrow()
        {
            const string varName  = "varName";
            const string varValue = "varValue";
            var          mockAdvancedRecordsetFactory = new Mock <IAdvancedRecordsetFactory>();

            //mockAdvancedRecordsetFactory.Setup(advancedRecordsetFactory => advancedRecordsetFactory.New(It.IsAny<IExecutionEnvironment>())).Returns(mockAdvancedRecordset.Object)

            //TODO: Merge constructors

            using (var viewModel = new AdvancedRecordsetActivityWorker(null, null, mockAdvancedRecordsetFactory.Object))
            {
                viewModel.AddDeclarations(varName, varValue);
            }
        }
Esempio n. 2
0
        public void AdvancedRecordsetActivityWorker_AddDeclarations()
        {
            const string varName  = "varName";
            const string varValue = "varValue";
            var          mockAdvancedRecordset = new Mock <IAdvancedRecordset>();

            mockAdvancedRecordset.Setup(advancedRecordset => advancedRecordset.CreateVariableTable());
            mockAdvancedRecordset.Setup(advancedRecordset => advancedRecordset.InsertIntoVariableTable(varName, varValue));
            var mockAdvancedRecordsetFactory = new Mock <IAdvancedRecordsetFactory>();

            mockAdvancedRecordsetFactory.Setup(advancedRecordsetFactory => advancedRecordsetFactory.New(It.IsAny <IExecutionEnvironment>())).Returns(mockAdvancedRecordset.Object);

            using (var viewModel = new AdvancedRecordsetActivityWorker(null, mockAdvancedRecordset.Object, mockAdvancedRecordsetFactory.Object))
            {
                viewModel.AddDeclarations(varName, varValue);
                mockAdvancedRecordset.Verify(advancedRecordset => advancedRecordset.CreateVariableTable(), Times.Once);
                mockAdvancedRecordset.Verify(advancedRecordset => advancedRecordset.InsertIntoVariableTable(varName, varValue), Times.Once);
            }
        }