public async Task ProteinCollectionSerializerExtensions_ReadFileAsync_Test()
        {
            var serializer = new ProjectSummaryJsonDeserializer();
            var proteins   = await serializer.ReadFileAsync("TestFiles\\summary.json");

            Assert.AreEqual(627, proteins.Count);
        }
        public void ProteinCollectionSerializerExtensions_ReadFile_Test()
        {
            var serializer = new ProjectSummaryJsonDeserializer();
            var proteins   = serializer.ReadFile("TestFiles\\summary.json");

            Assert.AreEqual(627, proteins.Count);
        }
        public void ProjectSummaryJsonDeserializer_Deserialize_FromEmptyStream_Test()
        {
            var serializer = new ProjectSummaryJsonDeserializer();

            using (var stream = new MemoryStream())
            {
                var proteins = serializer.Deserialize(stream);
                Assert.AreEqual(0, proteins.Count);
            }
        }
        public void ProjectSummaryJsonDeserializer_Deserialize_Test()
        {
            var serializer = new ProjectSummaryJsonDeserializer();

            using (var stream = File.OpenRead("TestFiles\\summary.json"))
            {
                var proteins = serializer.Deserialize(stream);
                Assert.AreEqual(627, proteins.Count);
            }
        }
        public async Task ProjectSummaryJsonDeserializer_DeserializeAsync_Test()
        {
            var serializer = new ProjectSummaryJsonDeserializer();

            using (var stream = File.OpenRead("..\\..\\TestFiles\\summary.json"))
            {
                var proteins = await serializer.DeserializeAsync(stream);

                Assert.AreEqual(627, proteins.Count);
            }
        }
Exemple #6
0
        public void ProteinCollection_Ctor_FromProjectSummary()
        {
            // Arrange
            var client = new WebClient();

            using (var stream = new MemoryStream(client.DownloadData(ProjectSummaryUrl.Json)))
            {
                stream.Position = 0;
                var deserializer = new ProjectSummaryJsonDeserializer();
                var proteins     = deserializer.Deserialize(stream);
                var collection   = new ProteinCollection(proteins);
                Assert.IsTrue(collection.Count > 0);
            }
        }