Esempio n. 1
0
        public void btnImport_Click_WhenErrorReadingFile_EmailImportFormIsBuilt()
        {
            // Arrange
            Initialize();
            _dataCollectionTable = null;
            var emailImportFormIsBuilt = false;

            ShimFileImporter.GetDataTableByFileTypeStringStringStringStringInt32Int32String = (a, b, c, d, e, maxRecordToRetreive, f) =>
            {
                if (maxRecordToRetreive > 1)
                {
                    emailImportFormIsBuilt = true;
                    return(_dataFile);
                }
                else
                {
                    throw new Exception();
                }
            };

            // Act
            CallMethod(
                _newGroupImportType,
                "btnImport_Click",
                _methodArgs,
                _newGroupImportObject);

            // Assert
            _dataCollectionTable = GetField(_newGroupImportObject, "dataCollectionTable");
            _dataCollectionTable.ShouldSatisfyAllConditions(
                () => _dataCollectionTable.ShouldNotBeNull(),
                () => emailImportFormIsBuilt.ShouldBeTrue());
        }