예제 #1
0
 public void BeforeEachTest()
 {
     _input    = Substitute.For <IGetInputFromUsers>();
     _contacts = Substitute.For <IHandleContacts>();
     _recipes  = Substitute.For <IHandleRecipes>();
     _rolodex  = new Rolodex(_contacts, _recipes, _input);
 }
예제 #2
0
 [SetUp]    //runs before each test runs
 public void BeforeEachTest()
 {
     //Substitute dynamically creates a class in the background that
     //implements the interface
     _input    = Substitute.For <IGetInputFromUsers>();
     _contacts = Substitute.For <IHandleContacts>();
     _recipes  = Substitute.For <IHandleRecipes>();
     _rolodex  = new Rolodex(_contacts, _recipes, _input);
 }
예제 #3
0
        public void ExitJustDoesNothing()
        {
            //Arrange
            IGetInputFromUsers input = Substitute.For <IGetInputFromUsers>();

            input.GetNumber().Returns(0);

            IHandleContacts _contacts = Substitute.For <IHandleContacts>();
            IHandleRecipes  _recipes  = Substitute.For <IHandleRecipes>();

            Rolodex rolodex = new Rolodex(_contacts, _recipes, _input);

            //Act
            _rolodex.DoStuff();

            //Assert
            _input.Received().GetNumber();
            _contacts.DidNotReceive().GetAllContacts();
            _recipes.DidNotReceive().GetAllRecipes();
            _contacts.DidNotReceiveWithAnyArgs().CreateCompany(null, null);
        }
예제 #4
0
        static void Main(string[] args)
        {
            Rolodex rolodex = new Rolodex();

            rolodex.DoStuff();
        }
예제 #5
0
 private void Child_Fetch(Rolodex.Data.CompanyInfo company)
 {
     LoadProperty(CompanyIDProperty, company.CompanyID);
     LoadProperty(CompanyNameProperty, company.CompanyName);
 }
예제 #6
0
 internal static CompanyInfo GetCompanyInfo(Rolodex.Data.CompanyInfo company)
 {
     return DataPortal.FetchChild<CompanyInfo>(company);
 }