Ejemplo n.º 1
0
        public void Can_Send_ProtoBuf_request()
        {
            var client = new ProtoBufServiceClient(Config.NServiceKitBaseUri);

            var request = new ProtoBufEmail {
                ToAddress      = "*****@*****.**",
                FromAddress    = "*****@*****.**",
                Subject        = "Subject",
                Body           = "Body",
                AttachmentData = Encoding.UTF8.GetBytes("AttachmentData"),
            };

            try
            {
                var response = client.Send <ProtoBufEmail>(request);

                Console.WriteLine(response.Dump());

                Assert.That(response.Equals(request));
            }
            catch (WebServiceException webEx)
            {
                Console.WriteLine(webEx.ResponseDto.Dump());
                Assert.Fail(webEx.Message);
            }
        }
Ejemplo n.º 2
0
        /// <summary>Determines whether the specified <see cref="T:System.Object" /> is equal to the current <see cref="T:System.Object" />.</summary>
        ///
        /// <param name="other">The prototype buffer email to compare to this object.</param>
        ///
        /// <returns>true if the specified <see cref="T:System.Object" /> is equal to the current <see cref="T:System.Object" />; otherwise, false.</returns>
		public bool Equals(ProtoBufEmail other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			return Equals(other.ToAddress, ToAddress) 
				&& Equals(other.FromAddress, FromAddress) 
				&& Equals(other.Subject, Subject) 
				&& Equals(other.Body, Body)
				&& other.AttachmentData.EquivalentTo(AttachmentData);
		}
Ejemplo n.º 3
0
 /// <summary>Determines whether the specified <see cref="T:System.Object" /> is equal to the current <see cref="T:System.Object" />.</summary>
 ///
 /// <param name="other">The prototype buffer email to compare to this object.</param>
 ///
 /// <returns>true if the specified <see cref="T:System.Object" /> is equal to the current <see cref="T:System.Object" />; otherwise, false.</returns>
 public bool Equals(ProtoBufEmail other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.ToAddress, ToAddress) &&
            Equals(other.FromAddress, FromAddress) &&
            Equals(other.Subject, Subject) &&
            Equals(other.Body, Body) &&
            other.AttachmentData.EquivalentTo(AttachmentData));
 }
Ejemplo n.º 4
0
		public void Can_Send_ProtoBuf_request()
		{
			var client = new ProtoBufServiceClient(Config.NServiceKitBaseUri);

			var request = new ProtoBufEmail {
				ToAddress = "*****@*****.**",
				FromAddress = "*****@*****.**",
				Subject = "Subject",
				Body = "Body",
				AttachmentData = Encoding.UTF8.GetBytes("AttachmentData"),
			};

			try
			{
				var response = client.Send<ProtoBufEmail>(request);

				Console.WriteLine(response.Dump());

				Assert.That(response.Equals(request));
			}
			catch (WebServiceException webEx)
			{
				Console.WriteLine(webEx.ResponseDto.Dump());
				Assert.Fail(webEx.Message);
			}
		}
Ejemplo n.º 5
0
        /// <summary>Anies the given request.</summary>
        ///
        /// <param name="request">The request.</param>
        ///
        /// <returns>An object.</returns>
        public object Any(ProtoBufEmail request)
		{
			return request;
		}
Ejemplo n.º 6
0
 /// <summary>Anies the given request.</summary>
 ///
 /// <param name="request">The request.</param>
 ///
 /// <returns>An object.</returns>
 public object Any(ProtoBufEmail request)
 {
     return(request);
 }