This is a migrated thread and some comments may be shown as answers.

Null Reference Exception when trying to start a WPF app.

2 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 10 Mar 2016, 06:16 AM

I have downloaded the latest version of the Testing Framework and I am trying to create my first test a WPF application.

I get a the following error when I try to run the test.

Test Name: TestMethod1
Test FullName: UnitTestProject1.UnitTest1.TestMethod1
Test Source: c:\Dev\PARM\UnitTestProject1\UnitTest1.cs : line 15
Test Outcome: Failed
Test Duration: 0:00:00.0284715

Result Message:
Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: 
System.NullReferenceException: Object reference not set to an instance of an object.
Result StackTrace: at UnitTestProject1.UnitTest1.TestMethod1() in c:\Dev\PARM\UnitTestProject1\UnitTest1.cs:line 16

 

My test method is:

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.TestTemplates;

using ArtOfTest.WebAii.Wpf;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            WpfApplication wpfApp2 = Manager.Current.LaunchNewApplication(@"C:\Dev\PARM\PARM\bin\Debug\PARM.exe");
        }
    }
}

2 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 10 Mar 2016, 06:28 AM
I have figured this out. I needed to create the test using the xUnit_WPF using Add->New Item and then select from the Telerik framework options.
0
Ivaylo
Telerik team
answered on 14 Mar 2016, 07:53 AM
Hеllo Paul,

Glad to hear you have figured it out.

I am closing this case.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or