I am not in the habbit of testing internal/friend methods, properties or anything else. Because I think testing public members should cover those. But sometimes you don’t really have a choice. In this case it’s the form designer that is the cause of my problems (not the first time) It by default creates controls and components as Friend which is fine by me since controls can be found via the ControlsCollection. But the components like timer, notifyicon and such are not in that controlscollection and thus can only be found by either resetting their accesslevel or by reflection.
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
Raising events on a mock is easy with Rhino mocks. I wrote a whole article about it. Way back then I wrote, If we try to use the same syntax on the parameterless event like so eventraiser.GetEventRaiser(e => e.event1 += null).Raise(null); we get an InvalidOperationException (You have called the event raiser with the wrong number of parameters. Expected 0 but was 0). Expected 0 but was 0 doesn’t sound completely right but I get the picture. If you try to raise an event on a parameterd event like you would on a parameterless event, like so eventraiser.Raise(e => e.event2 += null); then you get this InvalidOperationException (You have called the event raiser with the wrong number of parameters. Expected 1 but was 0) where the 1 is the number of parameters you should have.
This week was my first week trying the stand-up desk concept. While I had read of many people converting their office, I’m going to be reporting directly from the trenches, after spending a week in a cubicle with a stand-up desk and a list of architecture and development tasks that kept me tied to my desk, all day, every day. The Desk The last few months I have seen several posts about stand-up desks, with Ron Pereira showing his new setup, Kevin Mayer discussing accessorizing his work area, and Jon Miller taking the concept on the road. The thought intrigued me, but I wasn’t sure how I could implement it in a cubicle environment.
Scheduled! The SQL Saturday in Chicago team has been working pretty hard lately on the schedule. It was difficult to complete due to all of the sessions being so good. I was close to trying a two day event so we could get all ~70 submissions up the weekend of April 17th. You can now see the schedule up on the SQL Saturday site here Of course we had to pick what the location we are using could handle and I think the team did an excellent job. At last count we only have around 100 open spots left until we reach capacity so move quickly and get your registration in before the seats are taken.
If you are using snapshots be aware that running sp_helpdb reports wrong files. Let’s take a look by running some code First create a test database use master go CREATE DATABASE [test] ON PRIMARY ( NAME = N'test', FILENAME = N'C:test.mdf' ) LOG ON ( NAME = N'test_log', FILENAME = N'C:test_log.LDF' ) GO Now let’s create a table and populate it with some data USE test go create table TestTable (id int not null,somecol char(100) default 'a') go insert TestTable(id) select row_number() over (order by s1.id) from sysobjects s1 cross join sysobjects s2 go Now create the snapshot database
By now you probably have heard or seen the complains that there is no viable 64 bit VPN client that will work with a Cisco VPN. I myself either used a Virtual Machine (Virtual Box) or I have a dual boot system where I boot into the Fisher Price looking OS to VPN into work. Yesterday my suffering ended. I downloaded the Shrew Soft VPN Client For Windows and it has been working great. It will even import Cisco pcf files so that you don’t need to configure the VPN client if you already have the Cisco pcf files.
Visual Studio 2010 and .NET 4 release candidates are available for download Right now the downloads are only available to MSDN subscribers. On Wednesday February 10th the downloads will also be available to the general public You can find the download links here: http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx
Now that all my server are SQL Server 2008 I use SSMS with SSMS Toolpack and Toad. I don’t really use Query Analyzer anymore. The other day I found out that you can hide objects you don’t want to see in SSMS by using filters. Let’s first look at some code. Create a new database named test, create a new schema named Denis and then add 3 tables to the dbo schema and 3 tables to the Denis schema. Just run the code below
Here is something interesting to think about Create this table and insert these 2 rows create table TableName(id int, name varchar(50)) insert TableName values(1,'bla') insert TableName values(2,'bla2') Now if you try to do something like this SELECT TOP 1 ID,Name FROM TableName ORDER BY Name UNION ALL SELECT 0,'' You will get the following error **_Server: Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword ‘UNION’._** Interestingly, this same code will work if you use it in the following matter
ASP.NET MVC 2 RC 2 has been released and is available for download. For those that don’t know what ASP.NET MVC 2 is. ASP.NET MVC 2 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. The framework encourages developers to maintain a clear separation of concerns among the responsibilities of the application – the UI logic using the view, user-input handling using the controller, and the domain logic using the model. ASP.NET MVC applications are easily testable using techniques such as test-driven development (TDD).