Image Image Image Image Image
Scroll to Top

To Top

RIA lecture This is the archive of my lecture called "Rich Internet Applications" that took place from October 2010 to April 2011.

Lesson 06 – Unit Testing in Detail

On 16, Nov 2010 | 6 Kommentare | inRIA lecture | vonJohannes Hoppe

In this lecture I want to concentrate again on Unit Tests with Visual Studio 2010. I finished the lesson with a lot of open questions. I will try to address all of them.

You can prepare yourself by [googling|yahooing|binging] about the following keywords:

  • Dependencies, Dependency Injection
  • Mocking
  • Lambda Expressions
  • MsTest, NUnit
  • Moq

I will refer to revision 31 in SVN, which you can also download here:
WebNoteMvc_v0.4.zip





My next big topic will be AJAX and especially jQuery. Depending on the progress with the UT stuff I will open this chapter at Wednesday, too. No special preparation will be required, but the Firebug extension for Firefox would be helpful!

Tags | , ,

Kommentare

  1. Blogged: http://blog.johanneshoppe.de/2010/11/uni… – Lesson 06 – Unit Testing in Detail #rialecture #fb

  2. dixit

    public interface IAnimal
    {
    public string Name;
    void Run();
    }

    Error 1 Interfaces cannot contain fields C:\Users\Dipa\documents\visual studio 2010\Projects\funnyzoo\funnyzoo\Program.cs
    i do in this ?
    waht should

  3. It should be:

    public interface IAnimal
    {
    string Name { get; set; }
    void Run();
    }

  4. dixit

    Vielen Dank

  5. Jones

    Learn the terms of this particular domain (c# programming).

    A field is an object that is declared on the class directly.

    public interface IAnimal
    {
    public string Name;
    void Run();
    }

    „Name“ is a field, which means it is an instance variable of each object of the type IAnimal. In C#, this is not possible. Interfaces define behavior, not state.

    Still, you can fake state into it. A property defines that for a certain member there will be two methods generated at compile time, the get method and the set method. You can never call them explicitly, but you can use the declared member as if it was a member variable and use the assignment operator (on it)

    public interface IAnimal
    {
    string Name { get; set; }
    void Run();
    }

    Properties qualify as methods. Therefore you can put them on an interface. And, reconsidering what the compiler was saying:

    Error 1 Interfaces cannot contain fields C:\Users\Dipa\documents\visual studio 2010\Projects\funnyzoo\funnyzoo\Program.cs

    That is the short version of what I wrote. He gives you the „What“. You must find out „Why“. This is what university is meant to teach you.

    • ★★★ This is brilliant answer got the “comment of the month” award! ★★★

Kommentar absenden


Projekt-
Verfügbarkeit:
ab 01.01.2017