Пример #1
0
        private SyncFailureCell cellConfiguration(UITableViewCell cell, SyncFailureItem model)
        {
            var syncFailureCell = (SyncFailureCell)cell;

            syncFailureCell.Update(model);
            return(syncFailureCell);
        }
Пример #2
0
            public void SetsClientTypeIfConstructedWithAClient()
            {
                var client = Substitute.For <IThreadSafeClient>();

                client.Name.Returns("My Client");

                SyncFailureItem syncFailure = new SyncFailureItem(client);

                syncFailure.Type.Should().Be(ItemType.Client);
            }
Пример #3
0
            public void SetsTagTypeIfConstructedWithATag()
            {
                var tag = Substitute.For <IThreadSafeTag>();

                tag.Name.Returns("My Tag");

                SyncFailureItem syncFailure = new SyncFailureItem(tag);

                syncFailure.Type.Should().Be(ItemType.Tag);
            }
Пример #4
0
            public void SetsProjectTypeIfConstructedWithAProject()
            {
                var project = Substitute.For <IThreadSafeProject>();

                project.Name.Returns("My Project");

                SyncFailureItem syncFailure = new SyncFailureItem(project);

                syncFailure.Type.Should().Be(ItemType.Project);
            }
Пример #5
0
            public void SetsTheCorrectProperties()
            {
                var tag = Substitute.For <IThreadSafeClient>();

                tag.Name.Returns("My Client");
                tag.SyncStatus.Returns(SyncStatus.SyncFailed);
                tag.LastSyncErrorMessage.Returns("Something bad happened");

                SyncFailureItem syncFailure = new SyncFailureItem(tag);

                syncFailure.Name.Should().Be("My Client");
                syncFailure.SyncStatus.Should().Be(SyncStatus.SyncFailed);
                syncFailure.SyncErrorMessage.Should().Be("Something bad happened");
            }
Пример #6
0
        public void Update(SyncFailureItem model)
        {
            typeLabel.Text         = $"{model.Type}: ";
            nameLabel.Text         = model.Name;
            syncStatusLabel.Text   = model.SyncStatus.ToString();
            errorMessageLabel.Text = model.SyncErrorMessage;
            switch (model.SyncStatus)
            {
            case SyncFailed:
                syncStatusLabel.TextColor = UIColor.Red;
                break;

            case SyncNeeded:
                syncStatusLabel.TextColor = UIColor.DarkGray;
                break;

            default:
                break;
            }
        }