public void AddAttributeByPrimitives() {
			var req = new StoreRequest();
			req.Attributes.Add("http://att1", "value1", "value2");
			AttributeValues value = req.Attributes.Single();
			Assert.AreEqual("http://att1", value.TypeUri);
			Assert.IsTrue(MessagingUtilities.AreEquivalent(new[] { "value1", "value2" }, value.Values));
		}
 public void AddAttributeByValue()
 {
     var req = new StoreRequest();
     AttributeValues value = new AttributeValues();
     req.Attributes.Add(value);
     Assert.AreSame(value, req.Attributes.Single());
 }
		public void Serializable() {
			var store = new StoreRequest();
			store.Attributes.Add("http://someAttribute", "val1", "val2");
			var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
			var ms = new MemoryStream();
			formatter.Serialize(ms, store);
			ms.Position = 0;
			var store2 = formatter.Deserialize(ms);
			Assert.AreEqual(store, store2);
		}
		public void EqualityTests() {
			var req1 = new StoreRequest();
			var req2 = new StoreRequest();
			Assert.AreEqual(req1, req2);

			// Add attributes in different orders deliberately.
			req1.Attributes.Add("http://att1");
			Assert.AreNotEqual(req1, req2);
			req2.Attributes.Add("http://att2");
			Assert.AreNotEqual(req1, req2);
			req1.Attributes.Add("http://att2");
			Assert.AreNotEqual(req1, req2);
			req2.Attributes.Add("http://att1");
			Assert.AreEqual(req1, req2);
		}
		public async Task Store() {
			var request = new StoreRequest();
			var newAttribute = new AttributeValues(
				IncrementingAttribute,
				"val" + (this.incrementingAttributeValue++).ToString(),
				"val" + (this.incrementingAttributeValue++).ToString());
			request.Attributes.Add(newAttribute);

			var successResponse = new StoreResponse();
			successResponse.Succeeded = true;

			await this.RoundtripAsync(Protocol.Default, new[] { request }, new[] { successResponse });

			var failureResponse = new StoreResponse();
			failureResponse.Succeeded = false;
			failureResponse.FailureReason = "Some error";

			await this.RoundtripAsync(Protocol.Default, new[] { request }, new[] { failureResponse });
		}
        public void Store()
        {
            var request = new StoreRequest();
            var newAttribute = new AttributeValues(
                IncrementingAttribute,
                "val" + (incrementingAttributeValue++).ToString(),
                "val" + (incrementingAttributeValue++).ToString());
            request.Attributes.Add(newAttribute);

            var successResponse = new StoreResponse();
            successResponse.Succeeded = true;

            ExtensionTestUtilities.Roundtrip(Protocol.Default, new[] { request }, new[] { successResponse });

            var failureResponse = new StoreResponse();
            failureResponse.Succeeded = false;
            failureResponse.FailureReason = "Some error";

            ExtensionTestUtilities.Roundtrip(Protocol.Default, new[] { request }, new[] { failureResponse });
        }
		public void Ctor() {
			var req = new StoreRequest();
			Assert.IsFalse(req.Attributes.Any());
		}