예제 #1
0
        public void NoteItem_ConvertBackTest()
        {
            var dto  = ItemDTOsHelper.CreateNoteItemDTO();
            var item = dto.ConvertBack();

            Assert.True(item is NoteItem);
            var noteItem = item as NoteItem;

            AssertGeneral(noteItem);
        }
예제 #2
0
        public void NoteItem_Test()
        {
            var dto  = ItemDTOsHelper.CreateNoteItemDTO();
            var item = BitwardenItemDtoToItemConverter.Convert(dto);

            Assert.True(item is NoteItem);
            var noteItem = item as NoteItem;

            AssertGeneral(noteItem);
        }
예제 #3
0
        public void Fields_Test()
        {
            var dto = ItemDTOsHelper.CreateNoteItemDTO();

            dto.Fields = new List <BitwardenItemFieldDTO>
            {
                new BitwardenItemFieldDTO
                {
                    Name  = FIELD_NAME,
                    Value = FIELD_VALUE,
                    Type  = FIELD_TYPE
                }
            };

            var noteItem = (NoteItem)BitwardenItemDtoToItemConverter.Convert(dto);

            Assert.Single(noteItem.Fields);
            Assert.Equal(FIELD_NAME, noteItem.Fields[0].Name);
            Assert.Equal(FIELD_VALUE, noteItem.Fields[0].Value);
            Assert.Equal(FIELD_TYPE, noteItem.Fields[0].Type);
        }