Search Results

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

Page 11/24 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Visual Studio Unit Testing of Windows Forms

    - by GWLlosa
    We're working on a project here in Visual Studio 2008. We're using the built-in testing suite provided with it (the Microsoft.VisualStudio.TestTools.UnitTesting namespace). It turns out, that much to our chagrin, a great deal of complexity (and therefore errors) have wound up coded into our UI layer. While our unit tests do a decent job of covering our business layer, our UI layer is a constant source of irritation. We'd ideally like to unit-test that, as well. Does anyone know of a good "Microsoft-compatible" way of doing that in visual studio? Will it introduce some sort of conflict to 'mix' unit testing frameworks like nUnitForms with the Microsoft stuff? Are there any obvious bear traps I should be aware of with unit-testing forms?

    Read the article

  • How to unit test configs

    - by ForeverDebugging
    We're working with some very large config files which contain lots of Unity and WCF configuration. When we open some of these configs in the SVC config editor or even try to open a web application using these configs, we recieve errors showing any typos or errors. E.g. a WCF binding is invalid or does not exist etc, or a configuration section does not exist, two endding tags, etc. Is there some way to "valid" a config through a unit test? So there's one less thing which could go wrong when the application is moved into a new environment.

    Read the article

  • How to programmatically generate WSDL from WCF service (Integration Testing)

    - by David Christiansen
    Hi All, I am looking to write some integration tests to compare the WSDL generated by WCF services against previous (and published) versions. This is to ensure the service contracts don't differ from time of release. I would like my tests to be self contained and not rely on any external resources such as hosting on IIS. I am thinking that I could recreate my IIS hosting environment within the test with something like... using (ServiceHost host = new ServiceHost(typeof(NSTest.HelloNS), new Uri("http://localhost:8000/Omega"))) { host.AddServiceEndpoint(typeof(NSTest.IMy_NS), new BasicHttpBinding(), "Primary"); ServiceMetadataBehavior behavior = new ServiceMetadataBehavior(); behavior.HttpGetEnabled = true; host.Description.Behaviors.Add(behavior); host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex"); host.Open(); } Does anyone else have any better ideas?

    Read the article

  • How to find the name of multiple files opened on system by unique id?

    - by Ashwin Upadhyay
    I want to know about the name of all currently opened MS-Word file by its unique id. I found unique id for one file but when I gave its destination path in code. My requirement is that when any user open Word file then the unique id of this file is passed into my code and through this code the name of this file is stored into database (but it is done backgroundly and for multiple files).

    Read the article

  • Constructing mocks in unit tests

    - by Flynn1179
    Is there any way to have a mock constructed instead of a real instance when testing code that calls a constructor? For example: public class ClassToTest { public void MethodToTest() { MyObject foo = new MyObject(); Console.WriteLine(foo.ToString()); } } In this example, I need to create a unit test that confirms that calling MethodToTest on an instance of ClassToTest will indeed output whatever the result of the ToString() method of a newly created instance of MyObject. I can't see a way of realistically testing the 'ClassToTest' class in isolation; testing this method would actually test the 'myObject.ToString()' method as well as the MethodToTest method.

    Read the article

  • Using Assert to compare two objects

    - by baron
    Hi everyone, Writing test cases for my project, one test I need is to test deletion. This may not exactly be the right way to go about it, but I've stumbled upon something which isn't making sense to me. Code is like this: [Test] private void DeleteFruit() { BuildTestData(); var f1 = new Fruit("Banana",1,1.5); var f2 = new Fruit("Apple",1,1.5); fm.DeleteFruit(f1,listOfFruit); Assert.That(listOfFruit[1] == f2); } Now the fruit object I create line 5 is the object that I know should be in that position (with this specific dataset) after f1 is deleted. Also if I sit and debug, and manually compare objects listOfFruit[1] and f2 they are the same. But that Assert line fails. What gives?

    Read the article

  • How to setup Expression Blend 3 add-in window at certain position ?

    - by j23tom..pl
    For example in Sketchflow add-in there is ApplicationFlowPane (derrived from PrototypingPane) which registers itself using IWindowService like this: service.RegisterPalette(this.PaletteRegistryName, this, this.Caption, this.KeyBinding); But i can't see where it is defined that it is docked on bottom pane. Before someone replies that it's at: %AppData%\Microsoft\Expression\Blend3\Workspaces No it's not there because those files do not exists at first run. The question is how can i put my window at certain position with Expression Blend 3 plug-in api ? update 1: It seems that to achive what i want i have to change design.xaml (where workspaces are defined) which is loaded from satellite assembly Microsoft.Expression.Blend.resources.dll (method load in class FrameworkPackage in Microsoft.Expression.Blend.dll). But since this dll is strongly named i can't change it. So now the question is. Is there any other way I can change Design Workspace at runtime ?

    Read the article

  • Best practices for multiple asserts on same result in C#

    - by asdseee
    What do you think is cleanest way of doing multiple asserts on a result? In the past I've put them all the same test but this is starting to feel a little dirty, I've just been playing with another idea using setup. [TestFixture] public class GridControllerTests { protected readonly string RequestedViewId = "A1"; protected GridViewModel Result { get; set;} [TestFixtureSetUp] public void Get_UsingStaticSettings_Assign() { var dataRepository = new XmlRepository("test.xml"); var settingsRepository = new StaticViewSettingsRepository(); var controller = new GridController(dataRepository, settingsRepository); this.Result = controller.Get(RequestedViewId); } [Test] public void Get_UsingStaticSettings_NotNull() { Assert.That(this.Result,Is.Not.Null); } [Test] public void Get_UsingStaticSettings_HasData() { Assert.That(this.Result.Data,Is.Not.Null); Assert.That(this.Result.Data.Count,Is.GreaterThan(0)); } [Test] public void Get_UsingStaticSettings_IdMatches() { Assert.That(this.Result.State.ViewId,Is.EqualTo(RequestedViewId)); } [Test] public void Get_UsingStaticSettings_FirstTimePageIsOne() { Assert.That(this.Result.State.CurrentPage, Is.EqualTo(1)); } }

    Read the article

  • How do I extend a WPF application using an addin-like architeture?

    - by Thiado de Arruda
    Lets say I have a WPF application that shows a ListBox with an ArrayList -populated with objects of arbitrary types- as a source, and this application is hosted in an assembly 'A'. By default the ListBox will display the custom object 'ToString' method return value. If a data template for that object type is found, the ListBox will use it for rendering. Imagine that theres another assembly 'B' that references of 'A' and seeks to extend it by providing custom data templates for certain types, to be used in that ListBox. Is there some way to do that without 'A'being aware of B?

    Read the article

  • Redundant assert statements in .NET unit test framework

    - by Prabhu
    Isn't it true that every assert statement can be translated to an Assert.IsTrue, since by definition, you are asserting whether something is true or false? Why is it that test frameworks introduce options like AreEquals, IsNotNull, and especially IsFalse? I feel I spend too much time thinking about which Assert to use when I write unit tests.

    Read the article

  • Unit Testing: hard dependency MessageBox.Show()

    - by Sean B
    What ways can the SampleConfirmationDialog be unit tested? The SampleConfirmationDialog would be exercised via acceptance tests, however how could we unit test it, seeing as MessageBox is not abstract and no matching interface? public interface IConfirmationDialog { /// <summary> /// Confirms the dialog with the user /// </summary> /// <returns>True if confirmed, false if not, null if cancelled</returns> bool? Confirm(); } /// <summary> /// Implementation of a confirmation dialog /// </summary> public class SampleConfirmationDialog : IConfirmationDialog { /// <summary> /// Confirms the dialog with the user /// </summary> /// <returns>True if confirmed, false if not, null if cancelled</returns> public bool? Confirm() { return MessageBox.Show("do operation x?", "title", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes; } }

    Read the article

  • Outlook VSTO AddIn for Meetings

    - by BigDubb
    We have created a VSTO addin for Outlook Meetings. As part of this we trap on the SendEvent of the message on the FormRegionShowing event: _apptEvents.Send += new Microsoft.Office.Interop.Outlook.ItemEvents_SendEventHandler(_apptEvents_Send); The method _apptEvents_Send then tests on a couple of properties and exits where appropriate. private void _apptEvents_Send(ref bool Cancel) { if (!_Qualified) { MessageBox.Show("Meeting has not been qualified", "Not Qualified Meeting", MessageBoxButtons.OK, MessageBoxIcon.Information); chkQualified.Focus(); Cancel = true; } } The problem that we're having is that some users' messages get sent twice. Once when the meeting is sent and a second time when the user re-opens outlook. I've looked for memory leaks, thinking that something might not be getting disposed of properly, and have added explicit object disposal on all finally calls to try and make sure resources are managed, but still getting the functionality incosistently across the organization. i.e. I never encountered the problem during development, nor other developers during testing. All users are up to date on framework (3.5 SP1) and Hotfixes for Outlook. Does anyone have any ideas on what might be causing this? Any ideas anyone might have would be greatly appreciated.

    Read the article

  • What Visual Studio add-ins do you use for C++ refactoring?

    - by Minyu
    I have just started using Visual Assist X for C++ refactoring in Visual Studio 2008. It is quite good, but IMO, not to the same level as what ReSharper has for C#. I am wondering what people are using for C++ refactoring, especially for larger code base. Here are the add-ins that I have tried so far: * Visual Assist X * Refactor! Pro Meanwhile, does anyone know if Visual Studio 2010 will have any real C++ refactoring tool built in? Many Thanks! Minyu

    Read the article

  • how to Add-in load again n again for every instance of an application?

    - by Ashwin Upadhyay
    I have one qus. i created one shared add-in in c#.net. This add-in is working fine. now i want this add-in is load again n again when any office application is opened. For e.g. when i open any MS word document then add-in is load for that and if after that i opened another MS word document without closing previously opened document then add-in is again load for newly opend MS word document. But when i opened MS word at first time the add-in is load and if i opened MS word again but add-in is already loaded. my requirement is like that-my add-in is worked backgroundly that is its work only to record the opening,closing time of the word document and how much time spend onto that word document and also the name of this document. But when i opened one word document then add-in is loaded for that and if againg opened new word document then becaz of previously opened document add-in is not load for that document remember that priviously opened document is not closed. but if i closed previously opened document then for new document add-in is load.

    Read the article

  • How to add an existing file to a project in VS2008 Add-in?

    - by miliu
    I'm trying to create an add-in for VS2008 to automate the unit tests. The test classes are located in a different project of the same solution. After the test class file is generated, I want to add it to that project automatically and make it active document. I could easily locate the test project, and I also found that testProject.DTE.ItemOperations.AddExistingItem(fileName) can be used to add an existing item to a project. However, this call always adds the item to the current project, instead of the testProject. I'm sure there must be an easy way to do it, but I couldn't figure it out. Your help is much appreciated.

    Read the article

  • Error with threads during automatic testing on TeamCity 5

    - by yeyeyerman
    Hello, I'm having some problems executing the tests of the application I'm developing. All the tests execute normally with ReSharper and in NCover. However, the execution of one of these tests in TeamCity is generating an error. This test initializes two objects, the object under test and a simulator of a real object. Both objects will communicate throug a serial link in a representation of the real scenario. ObjectSimulator r_simulator = new ObjectSimulator(...); ObjectDriver r_driver = new ObjectDriver(...); Assert.IsTrue(r_driver.Connect() == ErrorCode.Success); The simulator just do the following in the constructor public class ObjectSimulator { ... public ObjectSimulator() { // serial port configuration m_port = new SerialPort(); m_port.DataReceived += DataReceivedEvent; } ... } The main object has two threads. The main thread of the application and a timer to refresh a watchdog timer in the real object. public ErrorCode Connect() { ... StartSynchroTimer(); Thread.Sleep(4); // to check if the timer is working properly ... } The problem is comming from the Thread.Sleep() call, as when I remove it everything works. It seems like the ObjectSimulator also sleeps and doesn't receive the DataReceived event. How can I resolve this issue?

    Read the article

  • Is there a way in VS2008 (c#) to see all the possible exception types that can originate from a meth

    - by Matt
    Is there a way in VS2008 IDE for c# to see all the possible exception types that can possibly originate from a method call or even for an entire try-catch block? I know that intellisense or the object browser tells me this method can throw these types of exceptions but is there another way than using the object browser everytime? Something more accessible when coding? Furthermore, I don't think intellisense or the object browser do anything more than read the XML code comments. Shouldn't it be possible to scan a class's source and find all the exception types that can be thrown. (Forget path-ing based on method input, just scan the code for exception types) Am I wrong? Extending this idea, you should be able to hover over the 'try' or 'catch' keywords and present a tooltip with all the types of exceptions that can be thrown. My question boils down to, does a VS2008 add on like this exist? Does VS2010 do this perhaps? If not, could you implement it the way I've described, by scanning the class code for thrown exception types and would people find it useful. Exceptions bubble up so you have to scan every bit of code every method call, which I guess could be impractical, though I suppose you could build an index the first time and increase your speed that way. (It might be a cool little project....)

    Read the article

  • Is this basically what an IOC like NInject does?

    - by mrblah
    Normally I would do this: public class DBFactory { public UserDAO GetUserDao() { return new UserDao(); } } Where UserDao being the concrete implementation of IUserDao. So now my code will be littered with: DBFactory factory = new DBFactory(); IUserDao userDao = factory.GetUserDao(); User user = userDao.GetById(1); Now if I wanted to swap implementaitons, I would have to go to my DBFactory and change my code to call a different implementation. Now if I used NINject, I would bind the specific implementation on application startup, or via a config file. (or bind based on specific parameters etc. etc.). Is that all there is too it? Or is there more? (reason I am asking if I want to know how it will help me here: http://stackoverflow.com/questions/1930328/help-designing-a-order-manager-class)

    Read the article

  • C# code to start selenium-server on remote machine

    - by Naresh Thandu
    As part of my test automation, I have to start Selenium Server on my server. As of now I am manually executing a batch file to start selenium server on m,y machine. Batch file contains the following command. java -jar selenium-server-standalone-2.16.1.jar -role hub http://server.com:5555/grid/register But as I required it for my test automation, I want to automate running the selenium server on a remote server from my C# code. How do I do this?

    Read the article

  • Error with `Thread.Sleep` during automatic testing on TeamCity 5

    - by yeyeyerman
    Hello, I'm having some problems executing the tests of the application I'm developing. All the tests execute normally with ReSharper and in NCover. However, the execution of one of these tests in TeamCity is generating an error. This test initializes two objects, the object under test and a simulator of a real object. Both objects will communicate throug a serial link in a representation of the real scenario. ObjectSimulator r_simulator = new ObjectSimulator(...); ObjectDriver r_driver = new ObjectDriver(...); Assert.IsTrue(r_driver.Connect() == ErrorCode.Success); The simulator just do the following in the constructor public class ObjectSimulator { ... public ObjectSimulator() { // serial port configuration m_port = new SerialPort(); m_port.DataReceived += DataReceivedEvent; } ... } The main object has two threads. The main thread of the application and a timer to refresh a watchdog timer in the real object. public ErrorCode Connect() { ... StartSynchroTimer(); Thread.Sleep(4); // to check if the timer is working properly ... } The problem seems to be comming from the Thread.Sleep() call, as when I remove it everything works. The ObjectSimulator somehow doesn't execute the DataReceived event callback. How can I resolve this issue?

    Read the article

  • Outlook 2007 addins for filtering attachments accordingly to recipients.

    - by Susanta
    My question is that I need to send attached mail to domain users and non domain users. Domain users will receive .lnk of the attached file where as non domain users will receive physical file. Now I am doing by capturing send event of outlook and internally divided mail in two parts for domain users I crated .lnk of the file and attached it and sent to user. Where as for non domain users i attached the physical file and sent to the user. But these things are done by sending two mails internally so I am not able to maintain CC, BCC information. I need to do these things in one mail. So it is possible in outlook addins to filter attachments accordingly to recipients.

    Read the article

  • PartCover 2.5.3 win 7 x64

    - by user329814
    Could you tell me how you got PartCover running with VS2008 and win 7 x64? Based on this post http://stackoverflow.com/questions/256287/how-do-i-run-partcover-in-x64-windows, I ran c:\Program Files (x86)\Gubka Bob\PartCover .NET 2.3>CorFlags.exe PartCover.exe / 32BIT+ /Force with result Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.21022.8 Copyright (c) Microsoft Corporation. All rights reserved. corflags : warning CF011 : The specified file is strong name signed. Using /Force will invalidate the signature of this image and will require the assembly to be resigned. and c:\Program Files (x86)\NUnit 2.5.2\bin\net-2.0>CorFlags.exe nunit.exe /32BIT+ /Force with result Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.21022.8 Copyright (c) Microsoft Corporation. All rights reserved. Also, based on my discussion http://stackoverflow.com/questions/2546340/using-partcover-2-3-with-net-4-0-runtime/2964333#2964333, I also tried to use the x86 version of NUnit What I'm trying to run coverage for is the c# money sample for NUnit 2.5.2 I get the same System.Threading.ThreadInterruptedException --- System.Runtime.InteropServices.COMException (0x80040153): Retrieving the COM class factory for component with CLSID {FB20430E-CDC9-45D7-8453-272268002E08} failed due to the following error: 80040153 Thank you Edit: same thing with PartCover 2.2 My settings: exe file: C:\Program Files (x86)\NUnit 2.5.2\bin\net-2.0\nunit-console-x86.exe working dir: c:\Program Files (x86)\NUnit 2.5.2\samples\csharp\money\ work arg: /config=c:\Program Files (x86)\NUnit 2.5.2\samples\csharp\money\cs-money.csproj rules: +[]

    Read the article

  • Visual Studio &amp; TFS &ndash; List of addins, extensions, patches and hotfixes &ndash; Latest and Greatest

    - by terje
    This post is a list of the addins and extensions we (I ) recommend for use in Inmeta.  It’s coming up all the time – what to install, where are the download sites, etc etc, and thus I thought it better to post it here and keep it updated. The basics are Visual Studio 2010 connected to a Team Foundation Server 2010.  The edition of Visual Studio I use is the Ultimate Edition, but as many stay with the Premium Edition I’ve marked the extensions which only works with the Ultimate with a . I’ve also split the group into Recommended (which means Required) and Optional (which means Recommended) and Nice to Have (which means Optional) .   The focus is to get a setup which can be used for a complete coding experience for the whole ALM process.  The Code Gallery is found either through the Tools/Extension Manager menu in Visual Studio or through this link. The ones to really download is the Recommended category.  Then consider the Optional based on your needs.  The list of course reflects what I use for my work , so it is by no means complete, and for some of the tools there are equally useful alternatives.  The components directly associated with Visual Studio from Microsoft should be common, see the Microsoft column.     Product Available on Code Gallery Latest Version License Rec/Opt/N2H Applicable to Microsoft TFS Power Tools Sept 2010 Complete setup msi on link, split into parts on CG Sept 2010 Free Recommended TFS integration Yes Productivity Power Tools Yes 10.0.11019.3 Free Recommended Coding Yes Code Contracts No 1.4.30903 Free Recommended Coding & Quality Yes Code Contracts Editor Extensions Yes 1.4.30903 Free Recommended Coding & Quality Yes VSCommands Yes 3.6.4.1 Lite version Free (Good enough) Nice to have Coding No Power Commands Yes 1.0.2.3 Free Recommended Coding Yes FeaturePack 2   No.  MSDN Subscriber download under Visual Studio 2010 FP2 Part of MSDN Subscription Recommended Modeling & Testing Yes ReSharper No (Trial only) 5.1.1 Licensed Recommended Coding & Quality No dotTrace No 4.0.1 Licensed Optional Quality No NDepends No (Trial only) Licensed Optional Quality No tangible T4 editor Yes 1.950 Lite version Free (Good enough) Optional Coding (T4 templates) No Reflector No (Trial of Pro version only) 6.5 Lite version Free (Good enough) Recommended Coding/Investigation No LinqPad No 4.26.2 Licensed Nice to have Coding No Beyond Compare No 3.1.11 Licensed Recommended Coding/Investigation No Pex and Moles No (Moles available alone on CG) . Complete on MSDN Subscriber download under Visual Studio 2010 0.94.51023 Part of MSDN Subscription Optional Coding & Unit Testing Yes ApexSQL No Licensed Nice to have SQL No                 Some important Patches, upgrades and fixes Product Date Information Rec/Opt Applicable to Scrolling context menu KB2345133 and KB2413613 October 2010 Here Recommended Visual Studio MTM Patch October 2010 Here and here  KB2387011 Recommended (if you use MTM) MTM Data warehouse fix June 2010 Iteration dates fails with SQL 2008 R2.  KB2222312. Affects Burndown chart in Agile workbook Only for SQL 2008 R2 Server Upgrade 2008 to 2010 issue and hotfix August 2010 Fixes problems with labels and branches which are lost during upgrade. Apply before upgrade. Note: This has been fixed in the latest re-release of the TFS Server dated Aug 5th 2010. See here. Recommends downloading the latest bits. Only if upgrade from 2008 from earlier bits Server

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >