Search Results

Search found 582 results on 24 pages for 'nunit addins'.

Page 7/24 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Can I configure NUnit so that Debug.Fail doesn't show a message box when I run my tests?

    - by panamack
    I have this property: public SubjectStatus Status { get { return status; } set { if (Enum.IsDefined(typeof(SubjectStatus), value)) { status = value; } else { Debug.Fail("Error setting Subject.Status", "There is no SubjectStatus enum constant defined for that value."); return; } } } and this unit test [Test] public void StatusProperty_StatusChangedToValueWithoutEnumDefinition_StatusUnchanged() { Subject subject = new TestSubjectImp("1"); // assigned by casting from an int to a defined value subject.Status = (SubjectStatus)2; Assert.AreEqual(SubjectStatus.Completed, subject.Status); // assigned by casting from an int to an undefined value subject.Status = (SubjectStatus)100; // no change to previous value Assert.AreEqual(SubjectStatus.Completed, subject.Status); } Is there a way I can prevent Debug.Fail displaying a message box when I run my tests, but allow it to show me one when I debug my application?

    Read the article

  • Why in the world is this Moq + NUnit test failing?

    - by Dave Falkner
    I have this dataAccess mock object and I'm trying to verify that one of its methods is being invoked, and that the argument passed into this method fulfills certain constraints. As best I can tell, this method is indeed being invoked, and with the constraints fulfilled. This line of the test throws a MockException: data.Verify(d => d.InsertInvoice(It.Is<Invoice>(i => i.TermPaymentAmount == 0m)), Times.Once()); However, removing the constraint and accepting any invoice passes the test: data.Verify(d => d.InsertInvoice(It.IsAny<Invoice>()), Times.Once()); I've created a test windows form that instantiates this test class, runs its .Setup() method, and then calls the method which I am wishing to test. I insert a breakpoint on the line of code where the mock object is failing the test data.InsertInvoice(invoice); to actually hover over the invoice, and I can confirm that its .TermPaymentAmount decimal property is indeed zero at the time the method is invoked. Out of desperation, I even added a call back to my dataAccess mock: data.Setup(d => d.InsertInvoice(It.IsAny<Invoice>())).Callback((Invoice inv) => System.Windows.Forms.MessageBox.Show(inv.TermPaymentAmount.ToString("G17"))); And this gives me a message box showing "0". This is really baffling me, and no one else in my shop has been able to figure this out. Any help would be appreciated. A barely related question, which I should probably ask independently, is whether it is preferable to use Mock.Verify(...) as I have here, or to use Mock.Expect(...).Verifiable followed by Mock.VerifyAll() as I have seen other people doing? If the answer is situational, which situations would warrent the use of one over the other?

    Read the article

  • Using NUnit Testing How Can I test that a Save Dialog Box was displayed on the screen?

    - by user512915
    I am trying to programatically click the "save" button and test that the windows Save Dialog box appears: I have everything but the assert statement I believe. I don't know how to assert that my custom SaveDialogBox appears to the user. [test] public void Method_WhenThePersonIsNotfound_ClickingTheButtonSavesLetterToWordDocument { //arrange CreateNewPage(); //creates IE window enters fields and clicks submit on first page. //act this.InternetExplorerDriver.FindElementById("SaveForm").Click(); //assert //Assert statement to verify that when button was clicked the save dialog box to save the letter in word appears.

    Read the article

  • Using PartCover 2.3 with .NET 4.0 runtime?

    - by Roger Lipscombe
    I've successfully got PartCover 2.3 working with VS 2008 on my 64-bit machine. I'm now trying to get it to work with VS 2010 and NUnit 2.5.3. I've got NUnit using the correct CLR version, but I can't get PartCover to produce any output. All I get is an "empty" report XML file: <PartCoverReport date="2010-03-30T16:09:05.1009099+01:00" /> How do I get PartCover 2.3 (or 2.2, I guess) to work with NUnit 2.5.3 on .NET 4.0?

    Read the article

  • Unable to load <mytest> Because it is not located under Appbase

    - by Sam
    I have created a nunit project(NunitLoginTest.nunit) by selcting my test project in the nunit\bin directory and now I am trying to load that project but it is giving me the following error. Unable to load Because it is not located under Appbase, could not load file or assembly "nunitLogintest" or one of its dependencies. The system cannot find the specified path Can any one have any idea what is it related to. I also have checked my config file.

    Read the article

  • Regular Expressions. Remember it, write it, test it.

    - by outcoldman
    I should say that I’m fan of regular expressions. Whenever I see the problem, which I can solve with Regex, I felt a burning desire to do it and going to write new test for new regex. Previously I had installed SharpDevelop Studio just for good regular expression tool in it (Why VS doesn’t have one?). But now I’m a little wiser, and for each Regex I write a separate test. I find it difficult to remember the syntax of regular expressions (I don’t write them very often); I always forget which character is responsible for the beginning of the line, etc. So I use external small and easy articles like this “Regular expressions - An introduction”. Now I want to show you little samples of regular expressions and want to show you how to test these samples. Read more... (redirect to http://outcoldman.ru)

    Read the article

  • The art of Unit Testing with Examples in .NET

    - by outcoldman
    First time when I familiarized with unit testing was 5 or 6 years ago. It was start of my developing career. I remember that somebody told me about code coverage. At that time I didn’t write any Unit tests. Guy, who was my team lead, told me “Do you see operator if with three conditions? You should check all of these conditions”. So, after that I had written some code, I should go to interface and try to invoke all code which I wrote from user interface. Nice? At current time I know little more about tests and unit testing. I have not participated in projects, designed by Test Driven Development (TDD). Basics of my knowledge are a spying code of my colleagues, some articles and screencasts. I had decide that I should know much more, and became a real professional of unit testing, this is why I had start to read book The art of Unit Testing with Examples in .NET. More than, in my current job place looks like I’m just one who writing unit tests for my code. I should show good examples of my tests. ,a href="http://outcoldman.ru/en/blog/show/267"Read more...

    Read the article

  • Test Strategy for Addins

    - by Amit
    I was wondering if someone from the forum, can help me in uderstanding the type of Testing that will be performed, I mean a Test Strategy, we need to test things like Add-ins. Also need to know how can I reply to the person who has replied to my question, I kow its a bit not so mature quesiton, but if someone can explain. Regards Amit

    Read the article

  • guide for creating addins for Visual Studio 2010?

    - by JMarsch
    Hello: 2 questions actuall: Is there a good comprensive guide out there for creating add-ins for Visual Studio? Here's a weird specific problem -- I'm trying to get my add-in to load. The code that the wizard stubs into the OnConnect method will add it to the toolbar, but only if it passes this "if" statement: if (connectMode == ext_ConnectMode.ext_cm_UISetup) The problem is that connectMode never seems to equal ext_cm_UISetup. It always seems to equal ext_cm_AfterStartup, and My AddIn never appears on the toolbar. I could cheat and short-circuit the if, but since Visual Studio put that code there, I bet it's right, and I have something else wrong. According to the docs, the value should only ever be ext_cm_UISetup once -- the first time VS encounters the addin. So I probably need to somehow make VS forget about the add-in, but I can't find anywhere to do that. And by the way, isn't that exceptionally delicate? The reason I'm in this pickle is because I happened to get an exception on the first try, so now I can never try again?? Can't be right.

    Read the article

  • Making Separate Assemblies For Different Types Of Tests For The Same Component?

    - by sooprise
    I was told by a few members here that splitting up my unit tests into different assemblies for different components is the best way to structure unit tests. Now, I have a few questions about that idea. What are the advantages of this? Organization, and isolation of errors? Let's say I have a component named "calculator", and I create an assembly for the unit tests on "calculator". Would I create a separate assembly for the integration tests I want to run on "calculator"? Or is the definition of an integration test a test across multiple components, like "calculator" and whatever else, which would require a separate assembly to test both of them together? In that case, would I have one assembly to do all of the integration testing for every component combination?

    Read the article

  • CruiseControl.NET merge nunit and nant output

    - by JK
    I've just started using ccnet so I'm having trouble understanding why the merging of nant and nunit outputs are not working. I've setup my ccnet.config with typical values as found on google: <merge> <files> <file>D:\ccnet\path1\nant-results.xml</file> <file>D:\ccnet\path2\TestResult.xml</file> </files> </merge> <xmllogger /> Nant and ccnet are half working: if I deliberately put in a code error, then ccnet will say build failed. The same happens if I deliberately put in a failing test, ccnet will say build failed. But the ViewBuildReport.aspx page does not show any of the output from nant or nunit. Obviously I must be missing something, but I don't know what, any ideas? Thanks, JK

    Read the article

  • .dll Solidworks Add-in not registering in COM

    - by Abhijit
    I am trying to register this .dll in COM as an Add-in to Solid Works software. The dll is building without any error or warnings.But the Add-in is not appearing in the Windows "Registry Editor" as should be the case.Kindly suggest me a solution. Thanks in advance. Below is my code:- using System; using System.Collections; using System.Reflection; using System.Collections.Generic; using System.Linq; using System.Text; using SolidWorks.Interop.sldworks; using SolidWorks.Interop.swcommands; using SolidWorks.Interop.swconst; using SolidWorks.Interop.swpublished; using SolidWorksTools; using SolidWorksTools.File; using System.Runtime.InteropServices; using System.Diagnostics; namespace SWADDIN_Test { [ComVisible(true)] [Guid("C380F7A6-771A-41EE-807A-1689C8E97720")] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] interface ISWIntegration { void DoSWIntegration(); }//end of interface Dummy ISWIntegration [Guid("5EE80911-9567-4734-8E55-C347EA4635B5")] [ClassInterface(ClassInterfaceType.None)] [ProgId("SWADDIN_Test.SWIntegration")] [ComVisible(true)] public class SWIntegration : ISwAddin,ISWIntegration { public SldWorks mSWApplication; private int mSWCookie; public SWIntegration() { mSWApplication = null; mSWCookie = 0; }//end of parameterless constructor public void DoSWIntegration() { }//end of dummy method DoSWIntegration public bool ConnectToSW(object ThisSW, int Cookie) { mSWApplication = (SldWorks)ThisSW; mSWCookie = Cookie; // Set-up add-in call back info bool result = mSWApplication.SetAddinCallbackInfo(0, this, Cookie); this.UISetup(); return true; }//end of method ConnectToSW() public bool DisconnectFromSW() { return UITeardown(); }//end of method DisconnectFromSW() public void UISetup() { }//end of method UISetup() public bool UITeardown() { return true; }//end of method UITeardown() [ComRegisterFunction()]//Attribute private static void ComRegister(Type t) { string keyPath = String.Format(@"SOFTWARE\SolidWorks\AddIns{0:b}", t.GUID); using (Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(keyPath)) { rk.SetValue(null, 1);// Load at startup rk.SetValue("Title", "Abhijit_SwAddin"); // Title rk.SetValue("Description", "All your pixels now belong to us"); // Description }//end of using statement }//end of method ComRegister() [ComUnregisterFunction()]//Attribute private static void ComUnregister(Type t) { string keyPath = String.Format(@"SOFTWARE\SolidWorks\AddIns{0:b}", t.GUID); Microsoft.Win32.Registry.LocalMachine.DeleteSubKeyTree(keyPath); }//end of method ComUnregister() }//end of class SWIntegration }//end of namespace SWADDIN_Test

    Read the article

  • Selenium tests not building due to NUnit error (Mono+OS X)

    - by Jem
    I'm running Selenium RC on my Mac and driving my tests using NUnit in C#. My problem is that when I try and build a simple test in Mono I get the following error. Error CS0433: The imported type `NUnit.Framework.Assert' is defined multiple times (CS0433) (TestProject) When I comment out the Assert's it runs fine. The code I'm using currently is just a dump from the openqa site using System; using System.Text; using System.Text.RegularExpressions; using System.Threading; using NUnit.Framework; using Selenium; namespace SeleniumTests { [TestFixture] public class AllTests { private ISelenium selenium; private StringBuilder verificationErrors; [SetUp] public void SetupTest () { selenium = new DefaultSelenium ("localhost", 4444, "*safari", "http://www.google.co.uk"); selenium.Start (); verificationErrors = new StringBuilder (); } [TearDown] public void TeardownTest () { try { selenium.Stop (); } catch (Exception) { // Ignore errors if unable to close the browser } Assert.AreEqual ("", verificationErrors.ToString ()); } [Test] public void GoogleHomepageTests () { // Open Google search engine. selenium.Open ("http://www.google.com/"); // Assert Title of page. Assert.AreEqual ("Google", selenium.GetTitle ()); // Provide search term as "Selenium OpenQA" selenium.Type ("q", "Selenium OpenQA"); // Read the keyed search term and assert it. Assert.AreEqual ("Selenium OpenQA", selenium.GetValue ("q")); // Click on Search button. selenium.Click ("btnG"); // Wait for page to load. selenium.WaitForPageToLoad ("5000"); // Assert that "www.openqa.org" is available in search results. Assert.IsTrue (selenium.IsTextPresent ("www.openqa.org")); // Assert that page title is - "Selenium OpenQA - Google Search" Assert.AreEqual ("Selenium OpenQA - Google Search", selenium.GetTitle ()); } } } Any ideas? Is it a OSX/Mono thing?

    Read the article

  • Unit Test Organization

    - by cam
    I'm using Nunit for unit testing, and added another project called "Unit Testing" to my current solution. I referenced Nunit, and changed the Namespace to the same namespace used in the main project. I can't seem to figure out how to get access to all the classes, files, etc in the main project. Is there something I have to do to link two projects?

    Read the article

  • Accessing Custom Configurations in NUnit class

    - by Martin Ongtangco
    I'm really banging my head onto this one. I can't make the Custom Configuration to work with NUnit. It kept on failing to read the configuration file. I followed carefully this article: http://devlicio.us/blogs/derik_whittaker/archive/2006/11/13/app-config-and-custom-configuration-sections.aspx placed the references in the Unit test class App.Config, still everything failed. Is there some sort of a magic setting to do here?

    Read the article

  • How Best to Replace PL/SQL with C#?

    - by Mike
    Hi, I write a lot of one-off Oracle SQL queries/reports (in Toad), and sometimes they can get complex, involving lots of unions, joins, and subqueries, and/or requiring dynamic SQL, and/or procedural logic. PL/SQL is custom made for handling these situations, but as a language it does not compare to C#, and even if it did, it's tooling does not, and if even that did, forcing yet another language on the team is something to be avoided whenever possible. Experience has shown me that using SQL for the set based processing, coupled with C# for the procedural processing, is a powerful combination indeed, and far more readable, maintainable and enhanceable than PL/SQL. So, we end up with a number of small C# programs which typically would construct a SQL query string piece by piece and/or run several queries and process them as needed. This kind of code could easily be a disaster, but a good developer can make this work out quite well, and end up with very readable code. So, I don't think it's a bad way to code for smaller DB focused projects. My main question is, how best to create and package all these little C# programs that run ad hoc queries and reports against the database? Right now I create little report objects in a DLL, developed and tested with NUnit, but then I continue to use NUnit as the GUI to select and run them. NUnit just happens to provide a nice GUI for this kind of thing, even after testing has been completed. I'm also interested in suggestions for reporting apps generally. I feel like there is a missing piece or product. The perfect tool would allow writing and running C# inside of Toad, or SQL inside of Visual Studio, along with simple reporting facilities. All ideas will be appreciated, but let's make the assumption that PL/SQL is not the solution.

    Read the article

  • NUnit Test Case Code Generator Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information

    - by user1732969
    im trying to load an assembly nunit created in Monodevelop Im using the software NUnit Test Case Code Generator for create unit testing http://www.codeproject.com/Articles/28461/NUnit-Test-Case-Code-Generator After compiling the project in MonoDevelop, loading file .dll of the proyect in Nunit Test case generator the following error appears: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Can you help me?

    Read the article

  • Is there CI server software that can do all of this?

    - by SnOrfus
    I'm trying to put together a Continuous Integration server that will do the following: Work with subversion Use NUnit tests (fail build on failed tests) Use partcover (fail build on < X% coverage) Run code against FxCop (fail build on FxCop warnings, given settings) Run code against StyleCop (fail build on StyleCop warnings, given settings) Not as important: Be able to run from a sln file Be able to publish the application (ClickOnce is setup for the project already) I'm using TeamCity right now and it doesn't seem to do 3 or 5, and it doesn't have a runner for the newest NUnit. From the list of plugins that hudson has, it looks like it can do all of these except 3 (and the not as important requests). I've considered writing a plugin for hudons to use partcover, but that's adding more time to setting up a build server.

    Read the article

  • nunit2 Nant task always returns exit code 0 (TeamCity 5.0)

    - by Jonathan
    Hello, I just cannot for the life of me get my nant build file to terminate upon a test failure and return (thus preventing the packaging and artifact step from running) This is the unit part of the nant file: <target name="unittest" depends="build"> <nunit2 verbose="true" haltonfailure="false" failonerror="true" failonfailureatend="true"> <formatter type="Xml" /> <test assemblyname="Code\AppMonApiTests\bin\Release\AppMonApiTests.dll" /> </nunit2> </target> And regardless what combination of true/false i set the haltonfailure, failonerror, failonfailureatend properties to, the result is always this: [11:15:09]: Some tests has failed in C:\Build\TeamCity\buildAgent\work\ba5b94566a814a34\Code\AppMonApiTests\bin\Release\AppMonApiTests.dll, tests run terminated. [11:15:09]: NUnit Launcher exited with code: 1 [11:15:09]: Exit code 0 will be returned.1 Please help as i don't want to be publishing binarys where the unit tests have failed!!! TeamCity 5.0 build 10669 AppMonApiTests.dll references nunit.framework.dll v2.5.3.9345 unit isn't installed on the build server or GAC'd Using Nant-0.85 and Nantcontrib-0.85 Thanks, Jonathan

    Read the article

  • Unit Test to Run .sql script to SQL Create Database

    - by Lee Englestone
    Can anyone point me in the direction of how I could get a NUnit test to run a .sql file to Create / Setup a database. I know about the the TestFixtureSetUp and TestFixtureTearDown attributes / methods in NUnit. So I KNOW how to call methods before and after all or each unit tests. I'm just unsure of how to load and execute the contents of a .sql file agains a SQL Server 2005 database programatically. Any examples? This is part of our TDD / CI. We are wanting to create the database before and tear down the database after executing unit tests. Cheers, -- Lee

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >