Ejemplo n.º 1
0
        public void CheckPassedArtist_ArtistIsNull_ValidCall()
        {
            var model = new AddEditArtistViewModel(null, null);

            model.CheckPassedArtistAsync(null);

            Assert.False(model.CanSave);
            Assert.Null(model.InputModel.FirstName);
            Assert.Null(model.InputModel.LastName);
            Assert.Null(model.InputModel.Description);
        }
Ejemplo n.º 2
0
        public void CheckPassedArtist_WithArtist_ValidCall()
        {
            var artist = TestData.GetArtistSample().ToList()[1];
            var model  = new AddEditArtistViewModel(null, null);

            model.CheckPassedArtistAsync(artist);

            Assert.False(model.CanSave);
            Assert.Equal(artist.FirstName, model.InputModel.FirstName);
            Assert.Equal(artist.LastName, model.InputModel.LastName);
            Assert.Equal(artist.Description, model.InputModel.Description);
        }
Ejemplo n.º 3
0
        public void CanSave_InputValuesEqualsEditedArtist_ReturnsFalse()
        {
            var model  = new AddEditArtistViewModel(null, null);
            var artist = TestData.GetArtistSample().ToList()[1];

            model.SetErrorMessageChangesAsync();
            model.CheckPassedArtistAsync(artist);

            model.InputModel.FirstName   = artist.FirstName;
            model.InputModel.LastName    = artist.LastName;
            model.InputModel.Description = artist.Description;

            Assert.False(model.CanSave);
        }