Csharp

Moq - Setup Mock method specifying parameters of type

· Reading time: ~2 minute(s) (255 words) csharp programming testing moq

When working on my GameBrowser project this evening, I wanted to verify that a method setup on a mock object had been called when a property of the parameter object was a particular value.

My scenario was that I was writing a unit test for the Quake3 protocol client and within that protocol client, I build the payload to include the 4-byte prefix data, so I needed to test that it was doing that payload building part correctly. I may extract this logic out in the future if I need to, but currently it’s only used within the Quake3 protocol so it can remain here for now.

(Continue reading)

Umbraco 7: Create a custom Property Editor

· Reading time: ~4 minute(s) (805 words) programming umbraco umbraco7 csharp

Recently, I’ve been working on creating an implementation of Umbraco CMS for the Marketing team at work to use for quickly creating content for promotions etc. and the SEO Manager has asked what we could implement to benefit them in terms of SEO (Search Engine Optimisation for those who don’t know).

Requirements

Now, until working on this, I knew what SEO was, but had no idea what it entailed, so working with the SEO Manager, we outlined the following requirements for our initial (MVP) release. He needed to be able to edit the following:

(Continue reading)

Ribbon in .NET 4.5 using WPF and MVVM

· Reading time: ~2 minute(s) (243 words) programming csharp wpf

I’ve been spending some time recently to learn WPF a bit better including the MVVM pattern to encourage the separation of concerns between the view and the logic behind it.

It’s been a steep learning curve (to say the least!) but today I spent a bit of time looking into getting an Office-esque ribbon bar onto the main window of my dummy application. At first I wasn’t too sure, but I soon realised it’s not too dissimilar to any other button.

(Continue reading)

Connection problems in Visual Studio 2013

· Reading time: ~1 minute(s) (148 words) techsupport csharp visualstudio

Since installing Update 2 on the work laptop, I’ve been unable to check for available updates through the Tools > Extensions & Updates screen as it always timed out. If I continued working (without closing the IDE), it would eventually prompt me through the Notifications pane that it required credentials for the company proxy. Once I did that, it’d report updates etc. but over the last couple of days, that is no longer happening either.

(Continue reading)