This file contains 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
[Fact] | |
public void Tag_is_bound_to_model_on_construction() | |
{ | |
var model = new MainWindowViewModel(tag: "testing"); | |
var sut = new MainWindow(model); | |
sut.Show(); | |
var tag = sut.FindName("Tag") as TextBox; | |
Assert.Equal(model.Tag, tag.Text); |
This file contains 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 CourseTemplate | |
{ | |
public int Limit { get; set; } | |
public string Description { get; set; } | |
} | |
public struct Course | |
{ | |
public CourseTemplate Template { get; set; } | |
public bool IsMorning { get; set; } |
This file contains 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 Solution | |
{ | |
public CourseList MoringCourses { get; private set; } | |
public CourseList AfternoonCourses { get; private set; } | |
public Solution(CourseList moringCourses, CourseList afternoonCourses) | |
{ | |
AfternoonCourses = afternoonCourses; | |
MoringCourses = moringCourses; | |
} |
This file contains 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 coursePlan = new CoursePlan(new CourseList(), new RegistrantList(), 5); | |
var solution = coursePlan.Solve(); |
This file contains 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 CoursePlan | |
{ | |
private IEnumerable<Course> courses; | |
private IEnumerable<Registrant> registrants; | |
private readonly int instructorCount; | |
public CoursePlan(IEnumerable<Course> courses, IEnumerable<Registrant> registrants, int instructorCount) | |
{ | |
this.courses = courses; | |
this.registrants = registrants; |
This file contains 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 CourseTemplate | |
{ | |
public int Limit { get; private set; } | |
public string Description { get; private set; } | |
public CourseTemplate(int limit, string description) | |
{ | |
Description = description; | |
Limit = limit; | |
} |
This file contains 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 Registrant | |
{ | |
private readonly List<Course> courseWishes = new List<Course>(); | |
public IEnumerable<Course> CourseWishes { get { return courseWishes; } } | |
public string Name { get; private set; } | |
public Registrant(string name) | |
{ | |
Name = name; | |
} |
This file contains 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 Course | |
{ | |
private readonly List<Registrant> registrants = new List<Registrant>(); | |
public CourseTemplate Template { get; private set; } | |
public bool IsMorning { get; private set; } | |
public IEnumerable<Registrant> Registrants { get { return registrants; } } | |
public bool IsFull { get { return Template.Limit < registrants.Count; } } | |
public bool IsEmpty { get { return registrants.Count == 0; } } |
This file contains 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 CoursePlan | |
{ | |
private readonly IEnumerable<Course> courses; | |
private IEnumerable<Registrant> registrants; | |
private readonly int instructorCount; | |
public CoursePlan(IEnumerable<Course> courses, IEnumerable<Registrant> registrants, int instructorCount) | |
{ | |
this.courses = courses; | |
this.registrants = registrants; |
This file contains 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
module HelloFsNancy = | |
open System | |
open Nancy | |
open Nancy.Hosting.Self | |
type HelloModule() as self = | |
inherit NancyModule() | |
do | |
self.Get.["/"] <- |
OlderNewer