Example #1
0
        public async Task TestIfFunctionReturnIEnumberableObjectNumbersAsync()
        {
            // Arrange.
            var responseData    = File.ReadAllText("Sample Data\\input.json");
            var messageResponse = FakeHttpMessageHandler.GetStringHttpResponseMessage(responseData);
            var options         = new HttpMessageOptions
            {
                HttpMethod          = HttpMethod.Get,
                RequestUri          = "https://www.rijksmuseum.nl/api/nl/collection?key=secret&format=json&type=schilderij&toppieces=True",
                HttpResponseMessage = messageResponse
            };
            var messageHandler = new FakeHttpMessageHandler(options);
            var service        = new ObjectNumberRepository(messageHandler);
            var painting       = new Paintings(service);

            // Act.
            var results = (await painting.GetObjectNumberAsync("secret")).ToArray();

            // Assert.
            options.NumberOfTimesCalled.ShouldBe(1); // We only called that HttpMethod + Uri once.
            results.ShouldNotBeNull();
            results.Length.ShouldBe(10);
            results.First().ShouldBe("SK-A-3148");
        }
Example #2
0
 public System.Data.DataTable  GetPaintingsInDataTable(Paintings paintings, string MatchWith)
 {
     return(new DAL.PaintingsDAL().GetPaintingsInDataTable(paintings, MatchWith));
 }
Example #3
0
///<summary>
///This Method will Get record of Paintings  From your database in a Single Object of Class Paintings.
///Return Object if record Found other wise will throw an Execption of Type SQLExecption or return false in any other Problem
///Your are using Beta Version of Rapid Development (by Raees Ul Islam 0345-7294449
///</summary>
///</param name=Paintings>This is an Object of your Class Paintings</param>
        public Paintings GetPaintingsInObjectUsingID(Paintings paintings)
        {
            return(new DAL.PaintingsDAL().GetPaintingsInObjectUsingID(paintings));
        }
Example #4
0
///<summary>
///This Method will Delete and record of Paintings  in your database.
///Return true when data will Delete to your Data base other wise will throw an Execption of Type SQLExecption or return false in any other Problem
///Your are using Beta Version of Rapid Development (by Raees Ul Islam 0345-7294449
///</summary>
///</param name=Paintings>This is an Object of your Class Paintings</param>
        public bool Delete(Paintings paintings)
        {
            return(new DAL.PaintingsDAL().Delete(paintings));
        }
Example #5
0
///<summary>
///This Method will Update and record of Paintings  in your database.
///Return true when data will update to your Data base other wise will throw an Execption of Type SQLExecption or return false in any other Problem
///Your are using Beta Version of Rapid Development (by Raees Ul Islam 0345-7294449
///</summary>
///</param name=Paintings>This is an Object of your Class Paintings</param>
        public bool Update(Paintings paintings)
        {
            return(new DAL.PaintingsDAL().Update(paintings));
        }
Example #6
0
///<summary>
///This Method will insert and record of Paintings  in your database.
///Return true when data will insert to your Data base other wise will throw an Execption of Type SQLExecption or return false in any other Problem
///Your are using Beta Version of Rapid Development (by Raees Ul Islam 0345-7294449
///</summary>
///</param name=Paintings>This is an Object of your Class Paintings</param>
        public bool Insert(Paintings paintings)
        {
            return(new DAL.PaintingsDAL().Insert(paintings));
        }
Example #7
0
 public List <Paintings> GetPaintingsInList(Paintings paintings, string MatchWith)
 {
     return(new DAL.PaintingsDAL().GetPaintingsInList(paintings, MatchWith));
 }