public static void TestCreateConnectionValidation(Assert assert)
        {
                assert.Expect(1);
               
                ConnectionsViewModel vm = new ConnectionsViewModel(accounts[0].ToEntityReference(), null,0,null);
                ObservableConnection connection = vm.ConnectionEdit.GetValue();
                connection.Record1Id.SetValue(accounts[1].ToEntityReference());

                // Check the validation doesn't allow us to save without the role
                bool isValid = ((IValidatedObservable)connection).IsValid();
                assert.Equal(false, isValid, "Validation Not Valid");
  
        }
Exemplo n.º 2
0
 public static void CreateConnection(Assert assert)
 {
     assert.Expect(1);
     Action done = assert.Async();
     ObservableConnection vm = new ObservableConnection();
     vm.Record1Id.SetValue(accounts[0].ToEntityReference());
     vm.Record2Id.SetValue(accounts[1].ToEntityReference());
     vm.OnSaveComplete += delegate(string result)
     {
         assert.Equal(result, "Error", "Message = " + result);
         done();
     };
     vm.SaveCommand();
 }
        public static void TestCreateConnection(Assert assert)
        {

            assert.Expect(1);
            Action done = assert.Async();

            ConnectionsViewModel vm = new ConnectionsViewModel(accounts[0].ToEntityReference(), null,10,null);
            ObservableConnection connection = vm.ConnectionEdit.GetValue();
            connection.OnSaveComplete += delegate(string arg)
            {
                assert.Equal(arg, null, "Save Error " + arg);
                done();
            };

            connection.Record1Id.SetValue(accounts[1].ToEntityReference());
            connection.Record1RoleId.SetValue(partnerRole);

            // This should save ok
            connection.SaveCommand();
        }
Exemplo n.º 4
0
        public static void CheckConnectionsCollection(Assert assert)
        {
            // Add in the connection

            Entity connection = new Entity("connection");
            connection.SetAttributeValue("record1id", accounts[0].ToEntityReference());
            connection.SetAttributeValue("record2id", accounts[1].ToEntityReference());
            OrganizationServiceProxy.Create(connection);

            assert.Expect(1);
            Action done = assert.Async();
            ConnectionsViewModel vm = new ConnectionsViewModel(accounts[0].ToEntityReference(), null);
            vm.Connections.OnDataLoaded.Subscribe(delegate(EventData data, object args)
            {
                assert.Equal(vm.Connections.GetLength(), 1, "Only 1 connection");
                done();

            });
            vm.Search();
        }
Exemplo n.º 5
0
 public static void Test1(Assert assert)
 {
     assert.Expect(1);
     assert.Equal(false, false, "Message");
 }