This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var p = new Patient{ | |
PatientNo ="123", | |
FirstName = "John", | |
LastName = "Nolan, | |
FatherName = "Dad", | |
Children = new List { new Kid { FullName = "Johnetta" }, | |
new Kid { FullName = "Johnella" } } | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Patient | |
{ | |
public virtual string PatientNo { get; set; } | |
public virtual string FirstName { get; set; } | |
public virtual string LastName { get; set; } | |
public virtual string TCId { get; set; } | |
public virtual string FatherName { get; set; } | |
public virtual string MotherName { get; set; } | |
public virtual string Sex { get; set; } | |
public virtual IList Children { get; set;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Rounding | |
{ | |
[TestFixture] | |
public class Class1 | |
{ | |
//BRAIN HURTS | |
[Test] | |
public void Default() | |
{ | |
Assert.That(Decimal.Round(1.5m),Is.EqualTo(2)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StubPaymentAccountRepository : IPaymentAccountRepository | |
{ | |
public List<PaymentAccount> Payments { get; set; } | |
public StubPaymentAccountRepository() | |
{ | |
Payments = new List<PaymentAccount>(); | |
} | |
public void Add(IEnumerable<PaymentAccount> entities) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class When_blah | |
{ | |
static string s; | |
Establish that = () => s = null; | |
Because of = () => s= s.MyExt(); | |
It should_be_null = () => s.ShouldBeNull(); | |
} | |
public static class MyExts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyController | |
{ | |
//in state testing ALL we can test is the state of the result. | |
public ActionResult myAction() | |
{ | |
//some controller stuff | |
return result; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
namespace TestUoWPoC | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var style in Enum.GetValues(typeof(TradingStyle)).Cast<TradingStyle>()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome objWelcome = new Welcome(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I'm trying to dynamically build up criteria | |
ICriteria criteria = session.CreateCriteria<Client>().Add(BuildCriteria(clientParams)); | |
static ICriterion BuildCriteria(IEnumerable<MatchableClientParams> clientParams) | |
{ | |
var result = Restrictions.Disjunction(); | |
foreach (var parameters in clientParams) | |
{ |