Пример #1
0
        public void GetFileAttributes_NullValues_ThrowsArgumentNullException()
        {
            Assert.ThrowsException <ArgumentNullException>(() =>
            {
                FileReaderService.FileReaderService sut = new FileReaderService.FileReaderService();

                var result = sut.GetFileAttributes(null);
            }, "ArgumentNullException Thrown");
        }
Пример #2
0
        static void Main(string[] args)
        {
            IFileReaderServiceCallback callback = new FileReaderServiceCallback();
            InstanceContext            context  = new InstanceContext(callback);

            string request  = string.Empty;
            string response = string.Empty;

            FileReaderService.FileReaderService sc = new FileReaderService.FileReaderService();


            #region ParallelTasks
            Parallel.Invoke(
                () =>
            {
                using (FileReaderServiceProxy.FileReaderServiceProxy proxy = new FileReaderServiceProxy.FileReaderServiceProxy(context))
                {
                    ConsoleLogger logger = new ConsoleLogger();

                    try
                    {
                        logger.print_To_Client_FileReaderService();

                        logger.print_File_Info();

                        logger.print_Session_Info();
                    }

                    catch (FaultException <ApplicationException> e)
                    {
                        Console.WriteLine("FaultException<>: " + e.Detail.GetType().Name + " - " + e.Detail.Message);
                    }
                    catch (FaultException e)
                    {
                        Console.WriteLine("FaultException: " + e.GetType().Name + " - " + e.Message);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("EXCEPTION: " + e.GetType().Name + " - " + e.Message);
                    }
                }
            }

                );
            #endregion

            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
Пример #3
0
        public void PerCall_IsNotNull_AssertNotNull()
        {
            var sut = new FileReaderService.FileReaderService();

            Assert.IsNotNull(sut.PerCall_FileReader());
        }
Пример #4
0
        public void Echo_NullValues_ThrowsNotNullException()
        {
            var sut = new FileReaderService.FileReaderService();

            Assert.IsNotNull(sut.Echo(It.IsAny <string>()));
        }