NUnit.Framework.Assert.IsAssignableFrom(object)

Here are the examples of the csharp api class NUnit.Framework.Assert.IsAssignableFrom(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

88 Examples 7

1. Example

Project: Parrot
Source File: IdTests.cs
View license
[Test]
        public void ElementWithEmptyIdDeclaration()
        {
            var document = Parse("div#");
            Assert.IsAssignableFrom<MissingIdDeclaration>(document.Errors[0]);
        }

2. Example

Project: Parrot
Source File: AttributeTests.cs
View license
[Test]
        public void ElementWithAttributeValueOnlyAddsErrorToDocumentErrors()
        {
            var document = Parse("div[=\"value only\"]");
            Assert.IsAssignableFrom<AttributeIdentifierMissing>(document.Errors[0]);
        }

3. Example

Project: AttributeRouting
Source File: BugFixTests.cs
View license
[Test]
        public void Issue191_default_web_config_inits_web_http_constraint_factory()
        {
            var inMemoryConfig = new HttpWebConfiguration();
            Assert.IsAssignableFrom<AttributeRouting.Web.Http.WebHost.Framework.RouteConstraintFactory>(inMemoryConfig.RouteConstraintFactory);
        }

4. Example

Project: Parrot
Source File: AttributeTests.cs
View license
[Test]
        public void ElementWithEmptyAttributeBracketsAddsErrorToDocumentErrors()
        {
            var document = Parse("div[]");
            Assert.IsAssignableFrom<AttributeListEmpty>(document.Errors[0]);
        }

5. Example

Project: Parrot
Source File: ClassTests.cs
View license
[Test]
        public void ElementWithEmptyClassDeclaration()
        {
            var document = Parse("div.");
            Assert.IsAssignableFrom<MissingClassDeclaration>(document.Errors[0]);
        }

6. Example

Project: CoCSharp
Source File: CsvDataTableTests.cs
View license
[Test]
        public void Rows_And_Column_Are_GenericTypes()
        {
            var castedTable = (CsvDataTable<BuildingData>)_table;
            //Assert.IsAssignableFrom(typeof(CsvDataColumnCollection<BuildingData>), castedTable.Columns);
            Assert.IsAssignableFrom(typeof(CsvDataRowCollection<BuildingData>), castedTable.Rows);
        }

7. Example

Project: Parrot
Source File: AttributeTests.cs
View license
[Test]
        public void ElementWithMissingAttributeValueButWithEqualsAddsErrorToDocumentErrors()
        {
            var document = Parse("div[attr1=]");
            Assert.IsAssignableFrom<AttributeValueMissing>(document.Errors[0]);
        }

8. Example

Project: AttributeRouting
Source File: BugFixTests.cs
View license
[Test]
        public void Issue191_in_memory_web_config_inits_general_http_constraint_factory()
        {
            var inMemoryConfig = new HttpWebConfiguration(inMemory:true);
            Assert.IsAssignableFrom<AttributeRouting.Web.Http.Framework.RouteConstraintFactory>(inMemoryConfig.RouteConstraintFactory);
        }

9. Example

Project: Parrot
Source File: AttributeTests.cs
View license
[Test]
        public void AttributeValueWithMissingClosingQuoteAddsErrorToDocumentErrors()
        {
            var document = Parse("div[attr1=\"missing closing quote");
            Assert.IsAssignableFrom<EndOfStreamException>(document.Errors[0]);
        }

10. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void ElementWithEmptyAttributeBracketsAddsErrorToDocumentErrors()
            {
                var document = Parse("div[]");
                Assert.IsAssignableFrom<AttributeListEmpty>(document.Errors[0]);
            }

11. Example

Project: set-locale
Source File: UserControllerTest.cs
View license
[Test]
        public void reset_should_return_with_reset_model()
        {
            //act
            var sut = new UserControllerBuilder().BuildWithMockControllerContext();
            var view = sut.Reset() as ViewResult;

            //assert
            Assert.NotNull(view);
            var model = view.Model;
            Assert.NotNull(model);
            Assert.IsAssignableFrom(typeof(ResetModel), model);

            sut.AssertGetAttribute("Reset");
            sut.AssertAllowAnonymousAttribute("Reset");
        }

12. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void ElementWithEmptyClassDeclaration()
            {
                var document = Parse("div.");
                Assert.IsAssignableFrom<MissingClassDeclaration>(document.Errors[0]);
            }

13. Example

Project: set-locale
Source File: UserControllerTest.cs
View license
[Test]
        public async void login_should_return_with_login_model_if_model_is_invalid()
        {
            //arrange
            var invalidModel = new LoginModel { Email = "[email protected]" };

            //act
            var sut = new UserControllerBuilder().Build(); ;
            var view = await sut.Login(invalidModel) as ViewResult;

            //assert
            Assert.NotNull(view);
            var model = view.Model;
            Assert.NotNull(model);
            Assert.IsAssignableFrom(typeof(LoginModel), model);

            sut.AssertPostAndAntiForgeryTokenAttribute("Login", new[] { typeof(LoginModel) });
            sut.AssertAllowAnonymousAttribute("Login", new[] { typeof(LoginModel) });
        }

14. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseColor ()
		{
			var s = "0<span color='#ff0000'>12</span>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (1, ft.Attributes.Count);

			Assert.IsAssignableFrom<ColorTextAttribute> (ft.Attributes [0]);
			var at = (ColorTextAttribute)ft.Attributes [0];
			Assert.AreEqual (1, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (Colors.Red, at.Color);
		}

15. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseAnchor ()
		{
			var s = "<a href='http://foo.bar'>01</a><a/n ..... /n //View Source file for more details /n }

16. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseItalic ()
		{
			var s = "0<i>12</i>3<span font-style='oBlique'>45</span>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (2, ft.Attributes.Count);

			Assert.IsAssignableFrom<FontStyleTextAttribute> (ft.Attributes [0]);
			var at = (FontStyleTextAttribute)ft.Attributes [0];
			Assert.AreEqual (1, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (FontStyle.Italic, at.Style);

			Assert.IsAssignableFrom<FontStyleTextAttribute> (ft.Attributes [1]);
			at = (FontStyleTextAttribute)ft.Attributes [1];
			Assert.AreEqual (4, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (FontStyle.Oblique, at.Style);
		}

17. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseFontWeight ()
		{
			var s = "0<b>12</b><span weight='ultrabold'>34</span><span font-weight='Light'>56</span>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (3, ft.Attributes.Count);

			Assert.IsAssignableFrom<FontWeightTextAttribute> (ft.Attributes [0]);
			var at = (FontWeightTextAttribute)ft.Attributes [0];
			Assert.AreEqual (1, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (FontWeight.Bold, at.Weight);

			Assert.IsAssignableFrom<FontWeightTextAttribute> (ft.Attributes [1]);
			at = (FontWeightTextAttribute)ft.Attributes [1];
			Assert.AreEqual (3, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (FontWeight.Ultrabold, at.Weight);

			Assert.IsAssignableFrom<FontWeightTextAttribute> (ft.Attributes [2]);
			at = (FontWeightTextAttribute)ft.Attributes [2];
			Assert.AreEqual (5, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (FontWeight.Light, at.Weight);
		}

18. Example

Project: set-locale
Source File: UserControllerTest.cs
View license
[Test]
        public async void new_should_return_with_user_model_if_model_is_invalid()
        {
            //arrange
            var invalidModel = new UserModel { Name = "test name" };

            //act
            var sut = new UserControllerBuilder().Build();
            var view = await sut.New(invalidModel) as ViewResult;

            //assert
            Assert.NotNull(view);
            var model = view.Model;
            Assert.NotNull(model);
            Assert.IsAssignableFrom(typeof(UserModel), model);

            sut.AssertPostAndAntiForgeryTokenAttribute("New", new[] { typeof(UserModel) });
            sut.AssertAllowAnonymousAttribute("New", new[] { typeof(UserModel) });
        }

19. Example

Project: set-locale
Source File: AdminControllerTests.cs
View license
[Test]
        public async void new_translator_should_return_with_app_model_if_model_is_invalid()
        {
            //arrange
            var inValidModel = new UserModel { Name = "test name" };

            //act
            var sut = new AdminControllerBuilder().Build();
            var view = await sut.NewTranslator(inValidModel) as ViewResult;

            //assert
            Assert.NotNull(view);
            Assert.NotNull(view.Model);
            Assert.IsAssignableFrom(typeof(UserModel), view.Model);

            sut.AssertPostAndAntiForgeryTokenAttribute("NewTranslator", new[] { typeof(UserModel) });
        }

20. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void ElementWithEmptyIdDeclaration()
            {
                var document = Parse("div#");
                Assert.IsAssignableFrom<MissingIdDeclaration>(document.Errors[0]);
            }

21. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseBackgroundColor ()
		{
			var s = "0<span background-color='#0000ff'>12</span>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (1, ft.Attributes.Count);

			Assert.IsAssignableFrom<BackgroundTextAttribute> (ft.Attributes [0]);
			var at = (BackgroundTextAttribute)ft.Attributes [0];
			Assert.AreEqual (1, at.StartIndex);
			Assert.AreEqual (2, at.Count);
			Assert.AreEqual (Colors.Blue, at.Color);
		}

22. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void AttributeValueWithMissingClosingQuoteAddsErrorToDocumentErrors()
            {
                var document = Parse("div[attr1=\"missing closing quote");
                Assert.IsAssignableFrom<EndOfStreamException>(document.Errors[0]);
            }

23. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void ElementWithMissingAttributeValueButWithEqualsAddsErrorToDocumentErrors()
            {
                var document = Parse("div[attr1=]");
                Assert.IsAssignableFrom<AttributeValueMissing>(document.Errors[0]);
            }

24. Example

Project: set-locale
Source File: UserControllerTest.cs
View license
[Test]
        public void new_should_return_with_user_model()
        {
            //act
            var sut = new UserControllerBuilder().Build();

            var view = sut.New() as ViewResult;

            //assert
            Assert.NotNull(view);
            var model = view.Model;
            Assert.NotNull(model);
            Assert.IsAssignableFrom(typeof(UserModel), model);

            sut.AssertGetAttribute("New");
            sut.AssertAllowAnonymousAttribute("New");
        }

25. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void ElementWithAttributeValueOnlyAddsErrorToDocumentErrors()
            {
                var document = Parse("div[=\"value only\"]");
                Assert.IsAssignableFrom<AttributeIdentifierMissing>(document.Errors[0]);
            }

26. Example

Project: set-locale
Source File: UserControllerTest.cs
View license
[Test]
        public void login_should_return_with_login_model()
        {
            //act
            var sut = new UserControllerBuilder().Build();
            var view = sut.Login() as ViewResult;

            //assert
            Assert.NotNull(view);
            var model = view.Model;
            Assert.NotNull(model);
            Assert.IsAssignableFrom(typeof(LoginModel), model);

            sut.AssertGetAttribute("Login");
            sut.AssertAllowAnonymousAttribute("Login");
        }

27. Example

Project: set-locale
Source File: AdminControllerTests.cs
View license
[Test]
        public void new_translator_should_return_with_user_model()
        {
            //act
            var sut = new AdminControllerBuilder().Build();
            var view = sut.NewTranslator();
            var model = view.Model;

            //assert
            Assert.NotNull(view);
            Assert.NotNull(model);
            Assert.IsAssignableFrom(typeof(UserModel), model);

            sut.AssertGetAttribute("NewTranslator");
        }

28. Example

Project: linq2db
Source File: ParserTests.cs
View license
[Test]
		public void ConvertToSql2()
		{
			using (var db = new TestDataConnection())
			{
				var ctx = db.Parent
					.Select    (p1 => new { p = p1.ParentID + 1 })
					.Select    (p2 => p2.p)
					.GetMyContext();

				var sql = ctx.ConvertToSql(null, 0, ConvertFlags.Field);

				Assert.AreEqual        (1, sql.Length);
				Assert.IsAssignableFrom(typeof(SqlBinaryExpression), sql[0].Sql);
			}
		}

29. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithJobInfoAndInitializeSettings_ReturnsNewPrintJobStart()
        {
            var jobFile = @"C:\test.inf";
            string[] args = { $"/InfoDataFile={jobFile}", "/InitializeSettings" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPrintJobStart>(appStart);
        }

30. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPrintFileAndInitializeSettings_ReturnsPrintFileJobStart()
        {
            string[] args = { "-PrintFile=C:\\Test.txt", "-InitializeSettings" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<PrintFileStart>(appStart);
        }

31. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPdfFileAndInitializeSettings_ReturnsNewPrintJobStart()
        {
            var jobFile = @"C:\test.pdf";
            string[] args = { $"/PdfFile={jobFile}", "/InitializeSettings" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPdfJobStart>(appStart);
        }

32. Example

Project: linq2db
Source File: ParserTests.cs
View license
[Test]
		public void ConvertToSql4()
		{
			using (var db = new TestDataConnection())
			{
				var ctx = db.Parent
					.Select    (p1 => new { p1 })
					.Select    (p2 => p2.p1.ParentID)
					.GetMyContext();

				var sql = ctx.ConvertToSql(null, 0, ConvertFlags.Field);

				Assert.AreEqual        (1, sql.Length);
				Assert.IsAssignableFrom(typeof(SqlField), sql[0].Sql);
				Assert.AreEqual        ("ParentID", ((SqlField)sql[0].Sql).Name);
			}
		}

33. Example

Project: linq2db
Source File: ParserTests.cs
View license
[Test]
		public void ConvertToSql1()
		{
			using (var db = new TestDataConnection())
			{
				var ctx = db.Parent
					.Select    (p1 => new { p1.ParentID })
					.Select    (p2 => p2.ParentID)
					.GetMyContext();

				var sql = ctx.ConvertToSql(null, 0, ConvertFlags.Field);

				Assert.AreEqual        (1, sql.Length);
				Assert.IsAssignableFrom(typeof(SqlField), sql[0].Sql);
				Assert.AreEqual        ("ParentID", ((SqlField)sql[0].Sql).Name);
			}
		}

34. Example

Project: linq2db
Source File: ParserTests.cs
View license
[Test]
		public void ConvertToSql5()
		{
			using (var db = new TestDataConnection())
			{
				var ctx = db.Child
					.Select    (p => new { p, p.Parent })
					.Select    (p => new { p.Parent.ParentID, p.p.ChildID })
					.Select    (p => p.ParentID)
					.GetMyContext();

				var sql = ctx.ConvertToSql(null, 0, ConvertFlags.Field);

				Assert.AreEqual        (1, sql.Length);
				Assert.IsAssignableFrom(typeof(SqlField), sql[0].Sql);
				Assert.AreEqual        ("ParentID", ((SqlField)sql[0].Sql).Name);
			}
		}

35. Example

Project: linq2db
Source File: ParserTests.cs
View license
[Test]
		public void ConvertToSql3()
		{
			using (var db = new TestDataConnection())
			{
				var ctx = db.Parent
					.Select    (p1 => new { p = p1.ParentID + 1 })
					.Where     (p3 => p3.p == 1)
					.Select    (p2 => p2.p)
					.GetMyContext();

				var sql = ctx.ConvertToSql(null, 0, ConvertFlags.Field);

				Assert.AreEqual        (1, sql.Length);
				Assert.IsAssignableFrom(typeof(SelectQuery.Column), sql[0].Sql);
			}
		}

36. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void UnclosedElements ()
		{
			var s = "0<b><u>12</u>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (1, ft.Attributes.Count);
			Assert.IsAssignableFrom<UnderlineTextAttribute> (ft.Attributes [0]);
		}

37. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPsFileAndInitializeSettings_ReturnsNewPsJobStart()
        {
            var jobFile = @"C:\test.ps";
            string[] args = { $"/PsFile={jobFile}", "/InitializeSettings" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPsJobStart>(appStart);
        }

38. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseIncorrectlyNestedSpan ()
		{
			var s = "0<b><u>12</b></u>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (1, ft.Attributes.Count);
			Assert.IsAssignableFrom<UnderlineTextAttribute> (ft.Attributes [0]);
		}

39. Example

Project: xwt
Source File: FormattedTextTests.cs
View license
[Test]
		public void ParseBrokenMarkup ()
		{
			var s = "0<b<u>12</u>>";
			var ft = FormattedText.FromMarkup (s);
			Assert.AreEqual (1, ft.Attributes.Count);
			Assert.IsAssignableFrom<UnderlineTextAttribute> (ft.Attributes [0]);
		}

40. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithInitializeCustomSettings_ReturnsInitializeCustomSettingsStart()
        {
            string[] args = { @"/InitializeDefaultSettings=SettingsFile.ini" };
            var appStartFactory = BuildAppStartFactory();

            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<InitializeDefaultSettingsStart>(appStart);
            Assert.AreEqual("SettingsFile.ini", ((InitializeDefaultSettingsStart)appStart).SettingsFile);
        }

41. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPdfFile_ReturnsNewPsJobStart()
        {
            var jobFile = @"C:\test.pdf";
            string[] args = { $"/PdfFile={jobFile}" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPdfJobStart>(appStart);
            Assert.AreEqual(jobFile, ((NewDirectConversionJobStart)appStart).NewDirectConversionFile, "Wrong File in NewDirectConversionJobStart.");
        }

42. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPsFileAndManagePrintJobs_NewPsJobStartWithManagePrintJobs()
        {
            var jobFile = @"C:\test.ps";
            string[] args = { $"/PsFile={jobFile}", "/ManagePrintJobs" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPsJobStart>(appStart);
            Assert.IsTrue(((NewDirectConversionJobStart)appStart).StartManagePrintJobs);
        }

43. Example

View license
[Test]
        public void Use_Streaming()
        {
            var query = _bucket.CreateQuery("beer", "brewery_beers")
                .Limit(10)
                .UseStreaming(true);

            var count = 0;
            var result = _bucket.Query<dynamic>(query);
            foreach (var row in result.Rows)
            {
                count++;
                Assert.IsNotNull(row);
                Assert.IsNotNull(row.Id);
            }

            Assert.AreEqual(10, count);
            Assert.IsAssignableFrom<StreamingViewResult<dynamic>>(result);
        }

44. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPrintFileParameter_ReturnsPrintFileStartUp()
        {
            string[] args = { "/PrintFile=C:\\Test.txt" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<PrintFileStart>(appStart);
            Assert.AreEqual("C:\\Test.txt", ((PrintFileStart)appStart).PrintFile);
        }

45. Example

View license
[Test]
        public async Task Should_forward_message_to_error_queue()
        {
            MessagesFailedException exception = null;
            try
            {
                await Scenario.Define<Context>()
                    .WithEndpoint<RetryEndpoint>(b => b
                        .When((session, c) => session.SendLocal(new MessageWhichFailsRetries())))
                    .Done(c => c.ForwardedToErrorQueue)
                    .Run();
            }
            catch (AggregateException ex)
            {
                exception = ex.ExpectFailedMessages();
            }

            Assert.AreEqual(1, exception.FailedMessages.Count);
            var failedMessage = exception.FailedMessages.Single();

            var testContext = (Context) exception.ScenarioContext;
            Assert.AreEqual(typeof(MessageWhichFailsRetries).AssemblyQualifiedName, failedMessage.Headers[Headers.EnclosedMessageTypes]);
            Assert.AreEqual(testContext.PhysicalMessageId, failedMessage.MessageId);
            Assert.IsAssignableFrom(typeof(SimulatedException), failedMessage.Exception);

            Assert.AreEqual(1, testContext.Logs.Count(l => l.Message
                .StartsWith($"Moving message '{testContext.PhysicalMessageId}' to the error queue 'error' because processing failed due to an exception:")));
        }

46. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPdfFileAndManagePrintJobs_ReturnsNewPrintJobStartWithManagePrintJobs()
        {
            var jobFile = @"C:\test.pdf";
            string[] args = { $"/PdfFile={jobFile}", "/ManagePrintJobs" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPdfJobStart>(appStart);
            Assert.IsTrue(((NewDirectConversionJobStart)appStart).StartManagePrintJobs);
        }

47. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithInitializeCustomSettingsWithoutSettingsFile_ReturnsInitializeCustomSettingsStartWithSettingsFileNull()
        {
            string[] args = { @"/InitializeDefaultSettings" };
            var appStartFactory = BuildAppStartFactory();

            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<InitializeDefaultSettingsStart>(appStart);
            Assert.AreEqual(null, ((InitializeDefaultSettingsStart)appStart).SettingsFile);
        }

48. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithJobInfoAndManagePrintJobs_ReturnsNewPrintJobStartWithManagePrintJobs()
        {
            var jobFile = @"C:\test.inf";
            string[] args = { $"-InfoDataFile={jobFile}", "-ManagePrintJobs" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPrintJobStart>(appStart);
            Assert.IsTrue(((NewPrintJobStart)appStart).StartManagePrintJobs);
        }

49. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithJobInfo_ReturnsNewPrintJobStart()
        {
            var jobFile = @"C:\test.inf";
            string[] args = { $"/InfoDataFile={jobFile}" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<NewPrintJobStart>(appStart);
            Assert.AreEqual(jobFile, ((NewPrintJobStart)appStart).NewJobInfoFile, "Wrong JobInfoFile.");
        }

50. Example

Project: PDFCreator
Source File: AppStartFactoryTest.cs
View license
[Test]
        public void Called_WithPrintFileAndPrinterParameter_ReturnsPrintFileStartUpWithCorrectPrinter()
        {
            string[] args = { "/PrintFile=C:\\Test.txt", "/PrinterName=TestPrinter" };

            var appStartFactory = BuildAppStartFactory();
            var appStart = appStartFactory.CreateApplicationStart(args);

            Assert.IsAssignableFrom<PrintFileStart>(appStart);
            Assert.AreEqual("TestPrinter", ((PrintFileStart)appStart).PrinterName);
        }