コード例 #1
0
        public void GivenValidIExportFileFactory_WhenSetCurrent_ThenCurrentIExportFileFactoryIsSetToPassedInIExportFileFactory()
        {
            IExportFileFactory expected = MockRepository.GenerateMock <IExportFileFactory>();

            ExportFileFactory.SetCurrent(expected);

            Assert.AreEqual(expected, ExportFileFactory.Current);
        }
コード例 #2
0
        public void GivenStudentProfileExportFileType_WhenCreate_ThenStudentProfileExportFileReturned()
        {
            ExportFileFactory target = new ExportFileFactory();

            var result = target.Create(typeof(StudentProfileExportFile)) as StudentProfileExportFile;

            Assert.IsNotNull(result);
        }
コード例 #3
0
        public void GivenStudentProfileExportFileType_WhenCreate_ThenStudentProfileExportFileReturned()
        {
            ExportFileFactory target = new ExportFileFactory();

            var result = target.Create(typeof(StudentProfileExportFile)) as StudentProfileExportFile;

            Assert.IsNotNull(result);
        }
コード例 #4
0
 public void GivenNullIExportFileFactory_WhenSetCurrent_ThenArgumentNullException()
 {
     TestExtensions.ExpectException <ArgumentNullException>(() => ExportFileFactory.SetCurrent(null));
 }
コード例 #5
0
        public void GivenUnrecognizedType_WhenCreate_ThenThrowException()
        {
            ExportFileFactory target = new ExportFileFactory();

            target.ExpectException <InvalidOperationException>(() => target.Create(typeof(string)));
        }
コード例 #6
0
        public void GivenNullType_WhenCreate_ThenThrowException()
        {
            ExportFileFactory target = new ExportFileFactory();

            TestExtensions.ExpectException <ArgumentNullException>(() => target.Create(null));
        }
コード例 #7
0
        public void GivenUnrecognizedType_WhenCreate_ThenThrowException()
        {
            ExportFileFactory target = new ExportFileFactory();

            target.ExpectException<InvalidOperationException>(() => target.Create(typeof(string)));
        }
コード例 #8
0
        public void GivenNullType_WhenCreate_ThenThrowException()
        {
            ExportFileFactory target = new ExportFileFactory();

            TestExtensions.ExpectException<ArgumentNullException>(() => target.Create(null));
        }