Пример #1
0
        public static void Main()
        {
            var service = new VideoService();
            var title   = service.ReadVideoTitle();
            var loader  = new FileDownloader();

            loader.GetFile("123", "123");
        }
Пример #2
0
        public static void Main()
        {
            var service = new VideoService();
            var title   = service.ReadVideoTitle();

            //Dep Injection via Method Parameters
            //var title = service.ReadVideoTitle(new FileReader());
        }
Пример #3
0
 // Simulate using Video Services Class
 public static void Main()
 {
     // ARRANGE
     var service = new VideoService();
     // Method Parameter
     // var title = service.ReadVideoTitle(new FileReader());
     // ACT
     var result = service.ReadVideoTitle();
 }
Пример #4
0
        public static void Main()
        {
            var kernel = new StandardKernel();

            kernel.Load(Assembly.GetExecutingAssembly());
            var fileReader      = kernel.Get <IFileReader>();
            var videoRepository = kernel.Get <IVideoRepository>();

            var service = new VideoService(fileReader, videoRepository);
            var title   = service.ReadVideoTitle();
        }
Пример #5
0
        public static void Main()
        {
            //var service = new VideoService();

            //Dependency injection via method parameters
            //var title = service.ReadVideoTitle(new FileReader());

            //Dependency injection via properties
            //var title = service.ReadVideoTitle();

            //Dependency injection via constructor
            var service = new VideoService(new FileReader(), new VideoRepository());
            var title   = service.ReadVideoTitle();
        }
Пример #6
0
 public static void Main()
 {
     var service = new VideoService();
     var title   = service.ReadVideoTitle();
 }
Пример #7
0
 public static void Main()
 {
     var service = new VideoService();
     //var title = service.ReadVideoTitle(new FileReader()); //DI by method parameter
     var title = service.ReadVideoTitle(); //DI by property
 }
Пример #8
0
 public static void Main()
 {
     var service = new VideoService();
     //var title = service.ReadVideoTitle(new FileReader()); // This is done through Dependency Injection Frameworks (for making objects for these...)
     var title = service.ReadVideoTitle();
 }
Пример #9
0
 public static void Main()
 {
     var service = new VideoService();
     //var title = service.ReadVideoTitle(new FileReader());
     var title = service.ReadVideoTitle();
 }