0 Comments

Just a dump blog post for short development tips.

 

Microsoft Windows 8

Always run pinned programs on the taskbar as administrator
If you want the programs pinned on the windows taskbar to always be [Run as Administrator], the open the folder containing the windows taskbar pinned shortcuts:

  • %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
  • Right click pinned shortcut > Properties > Advanced…
  • Check [Run as administrator’]image
How to Disable Caps Lock Key in Windows
http://www.howtogeek.com/howto/windows-vista/disable-caps-lock-key-in-windows-vista/
 

 

 

Microsoft SQL Server 2012

Run a *.sql script
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd.exe" -S (localdb)\V11.0 -d MyDatabase -E -b -i "C:\Temp\script.sql"
Attach an existing database to a Local Db instance

Open the a command prompt with Administrator rights, then enter:
sqlcmd -S (localdb)\V11.0
use master
go

create database Cris on
(filename= N’C:\Databases\MyDatabase1.mdf’)
for attach;
go

 

 

Microsoft Visual Studio 2012

How to copy unit test output from the Test Explorer
You might think, you can’t copy the output of the unit test from the Test Explorer, because you can’t select the text, but if you click on the window and just press CTRL + C.
And in your code windows press CTRL – V, all output of the test is pasted in the code window.

image

Output pasted in the code window:
image

How to Assert code has thrown an exception in a MSTEST unit test

If you want to Assert if some code has thrown a specific exception with a specific message, you can wrap the code in a try – catch block, but you can also use XUnit assert in MSTEST, combining MSTEST en XUnit. 

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Assert = Xunit.Assert;

namespace Research.Rli.Tests
{
    [TestClass]
    public class ResearchTester
    {
        [TestMethod]
        public void Test()
        {
            string message = "The system detected an error.";
            Exception ex = Assert.Throws(typeof(ApplicationException),
                () => { throw new ApplicationException(message); });
            Assert.Equal(message, ex.Message);
        }
    }
}
How to show all pending changes for all users in TFS

http://geekswithblogs.net/MikeParks/archive/2009/09/16/tfs—view-all-pending-changes-for-all-users.aspx
 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts