Click here to Skip to main content
15,912,665 members
Home / Discussions / C#
   

C#

 
GeneralRe: stack / heap assignment under the hood Pin
harold aptroot29-Jul-14 4:52
harold aptroot29-Jul-14 4:52 
GeneralRe: stack / heap assignment under the hood Pin
taking_liberties29-Jul-14 6:42
taking_liberties29-Jul-14 6:42 
AnswerRe: stack / heap assignment under the hood Pin
OriginalGriff29-Jul-14 5:07
mveOriginalGriff29-Jul-14 5:07 
GeneralRe: stack / heap assignment under the hood Pin
Rob Philpott29-Jul-14 6:19
Rob Philpott29-Jul-14 6:19 
GeneralRe: stack / heap assignment under the hood Pin
OriginalGriff29-Jul-14 6:25
mveOriginalGriff29-Jul-14 6:25 
GeneralNot enough storage is available to complete this operation Pin
Tal Humy29-Jul-14 3:20
Tal Humy29-Jul-14 3:20 
QuestionRe: Not enough storage is available to complete this operation Pin
Eddy Vluggen29-Jul-14 6:24
professionalEddy Vluggen29-Jul-14 6:24 
GeneralRe: Not enough storage is available to complete this operation Pin
Bernhard Hiller29-Jul-14 20:43
Bernhard Hiller29-Jul-14 20:43 
QuestionOData 4 $InLineCount Pin
JoelPark28-Jul-14 10:58
JoelPark28-Jul-14 10:58 
AnswerRe: OData 4 $InLineCount Pin
OriginalGriff28-Jul-14 21:38
mveOriginalGriff28-Jul-14 21:38 
AnswerRe: OData 4 $InLineCount Pin
Kornfeld Eliyahu Peter28-Jul-14 22:20
professionalKornfeld Eliyahu Peter28-Jul-14 22:20 
GeneralRe: OData 4 $InLineCount Pin
JoelPark29-Jul-14 3:37
JoelPark29-Jul-14 3:37 
QuestionHow to retain Dropdownlist value after selectedindexchanged and postback?? Pin
lan160727-Jul-14 14:07
lan160727-Jul-14 14:07 
AnswerRe: How to retain Dropdownlist value after selectedindexchanged and postback?? Pin
Ron Nicholson28-Jul-14 4:48
professionalRon Nicholson28-Jul-14 4:48 
AnswerRe: How to retain Dropdownlist value after selectedindexchanged and postback?? Pin
Member 924543128-Jul-14 8:21
Member 924543128-Jul-14 8:21 
GeneralRe: How to retain Dropdownlist value after selectedindexchanged and postback?? Pin
lan160729-Jul-14 14:01
lan160729-Jul-14 14:01 
GeneralRe: How to retain Dropdownlist value after selectedindexchanged and postback?? Pin
Member 924543130-Jul-14 0:38
Member 924543130-Jul-14 0:38 
GeneralRe: How to retain Dropdownlist value after selectedindexchanged and postback?? Pin
lan160730-Jul-14 19:35
lan160730-Jul-14 19:35 
Questiontag clipboard text Pin
Jassim Rahma27-Jul-14 11:59
Jassim Rahma27-Jul-14 11:59 
AnswerRe: tag clipboard text Pin
Garth J Lancaster27-Jul-14 13:20
professionalGarth J Lancaster27-Jul-14 13:20 
Questionhow do i get a table in gridview according to combobox fields? Pin
Sajeev Unni27-Jul-14 7:29
Sajeev Unni27-Jul-14 7:29 
AnswerRe: how do i get a table in gridview according to combobox fields? Pin
Pete O'Hanlon27-Jul-14 8:09
mvePete O'Hanlon27-Jul-14 8:09 
AnswerRe: how do i get a table in gridview according to combobox fields? Pin
Swinkaran28-Jul-14 19:09
professionalSwinkaran28-Jul-14 19:09 
QuestionMVC unit testing Pin
Marsh8727-Jul-14 3:09
Marsh8727-Jul-14 3:09 
VB
I started to learn how to write mvc tests  from the following site http://www.asp.net/mvc/tutorials/older-versions/contact-manager/iteration-5-create-unit-tests-cs"

However when running the test I keep getting a object not set to instance exception  


 [TestMethod]
        public void CreateRace()
        {




            //Arrange

            RACE race = new RACE();

            race.RACE_CODE = 1;
            race.Logourl = "dasdad";
            race.RegattaCity = "Durban";
            race.RegattaProvince = "Kzn";
            race.RegattaStreetAddress = "232Chats";
            race.MAXPARTICA = 12;
            race.SECRETARY_EMAIL = "ssasda";
            race.SECRETARY_MOBILE = 1422434;
            race.SECRETARY_NAME = "jsjsjs";

            race.ENTRYAMOUNT = Convert.ToDecimal(23.58);

            race.EVENT_NAME = "sadada";
            race.status = "Active";
            race.UserId = 1;

            race.LATEENTRYAMOUNT = Convert.ToDecimal(23.58);

            string eventstart = "2014/05/12 12:02", eventend = "2014/05/17 12:02", entrydeadline = "2014/05/11 12:02", withdrawdate = "2014/05/11 12:02", YachtClubname = "durban";

            //Act
            var result = _service.CreateRace(race, eventstart, eventend, entrydeadline, withdrawdate, YachtClubname, "Kzn");




            //Assert

            Assert.IsTrue(result);
}

//Create Service Method
C#
public bool CreateRace(RACE race, string eventstart, string eventend, string entrydeadline, string withdrawaldate,string YachtClubname,string Province )
      {

          if (!ValidateRace( race,eventstart,  eventend,  entrydeadline, withdrawaldate,YachtClubname,Province))
              return false;

          // Database logic
          try
          {
              _repository.CreateRace(race, eventstart, eventend,  entrydeadline, withdrawaldate,YachtClubname,Province);

          }
          catch
          {
              return false;
          }
          return true;
      }

AnswerRe: MVC unit testing Pin
Pete O'Hanlon27-Jul-14 3:41
mvePete O'Hanlon27-Jul-14 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.