Esempio n. 1
0
        public void SocketClient_SendFileWithFileType_ToServer()
        {
            //Arrange
            var socketClient = _serviceProvider.GetService <ISocketClient>();
            //Act
            var client = socketClient.Connect("", 1201);

            var bytes = File.ReadAllBytes($@"{_filepath}\Files\Untitled Document.pdf");

            var finalBytes = Encoding.ASCII.GetBytes($@".pdf");

            Bytes.AppendSpecifiedBytes(ref finalBytes, bytes);

            socketClient.Send(client, finalBytes);

            //Assert
            Assert.True(client.Connected);

            client.Shutdown(SocketShutdown.Both);
        }