Exemplo n.º 1
0
        //Violates L and D
        //Both because we're not using and interface
        public void DoSomethingElseAgain(UpdateUserRecords update)
        {
            update.DoSomeUpdates();
            var emailDependency = new EmailDependency();

            emailDependency.SendMail();
        }
Exemplo n.º 2
0
        public void DoSomething()
        {
            //this will work, however it 'traps' this dependency in this method
            //there is no way to swap this for testing
            //Violates 'O', 'D' and 'L'
            //'L' and 'D' because we depend on a concrete class
            //'O' because there is no way to change the email dependency
            var emailDependency = new EmailDependency();

            emailDependency.SendMail();
        }