All entries for Wednesday 25 October 2006

October 25, 2006

Setting Up Code in VS

I created a Visual Studio solution that will hold all the code for the project. It will eventually contain:
  • Library – The code that has all the algorithms and data structures
  • Tests – NUnit test suites for the library
  • UI – Windows Form application to demo the library

Today I added Library and Tests projects to the solution. These are both Nemerle Class Library projects. I refactored yesterday’s experimental linear regression code into the library project to get the ball rolling.

The project root directory looks like this at the moment:

+ src
| + Equin.Vectorization.Library
  | - Equin.Vectorization.Library.nproj
  | - (various .n files)
| + Equin.Vectorization.Library.Tests
  | - Equin.Vectorization.Library.Tests.nproj
  | - Equin.Vectorization.Library.Tests.nunit
  | - (various .n files)
| - Equin.Vectorization.sln

A set of tests were also written to exercise the BestFit function.

Here is a sample of the testing code:

#pragma indent
using System
using NUnit.Framework
using Equin.Vectorization.Library

namespace Equin.Vectorization.Library.Tests
    [TestFixture] public class BestFit

        [Test] public Diagonal_Points() : void
            def points = [Point(0,0), Point(1,1), Point(2,2)]
            def line = points.BestFit()
            match (line)
                | Line.Normal(g, i) =>
                    Assert.AreEqual(1f, g)
                    Assert.AreEqual(0f, i)
                | _ => Assert.Fail("Line should have been Normal.")

Once compiled, the Tests assembly was opened in the NUnit test runner GUI. I may get a test runner for Visual Studio installed, so I don’t have to leave the IDE.

Having got the BestFit function working with the tests, I imported the solution into SubVersion (svn server runs on a separate machine downstairs). I then did the slightly annoying “rename old folder, create new folder, svn export” dance :) So I now have a solid project tree to work under.

I will need to setup a batch backup system soon to copy the repository to a university server. Maybe I’ll even get fancy continuous integration tool running to perform nightly builds, etc!

Google Ads

Search this blog

Most recent comments

  • I scratched my eye while i was holding some kind of plastic packaging.. Anyways the corner of the pl… by Ercan on this entry
  • About a year ago my contacts that i was wearing, i guess were fautly, because shortly after they wer… by Jon on this entry
  • I got shower gel in my eye 4 and a half days ago, and becasue i rubbed my eyes a lot, i have scratch… by Chris on this entry
  • This website may help–health/tc/Eye–Injuries–Home–Treatment by S on this entry
  • I somehow got dirt, or debris in my eye. The terrible pain sent me in a tailspin. I was afraid of sa… by Bobbi on this entry


October 2006

Mo Tu We Th Fr Sa Su
Sep |  Today  | Nov
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31               


Blog archive

Not signed in
Sign in

Powered by BlogBuilder