From what I understand there was a limited supply of enriched uranium/ weapons grade fissile material. So, in a situation where the number of bombs developed may be limited, why didn't they just go ahead and drop it?
There were two designs for the first atomic bombs, using different fuel types and different mechanisms.
One of the bombs, the gun-type bomb, known as Little Boy, used highly-enriched uranium. This was a design that, for technical reasons, you could essentially "partially test" without blowing anything up — you could run experiments that would give you great confidence that, in the event of actual detonation, you'd know what would happen. They thought this would be the "big" bomb of the two, and did not think they'd need to test it before using it. The downside to this design is that it required a phenomenal amount of fuel: 64 kg of highly-enriched uranium. They could produce about 1 kg of highly-enriched uranium fuel per day by the summer of 1945. So even if the bomb worked as planned, they'd only be able to produce one bomb of this sort every two months or so.
The other design used plutonium, a man-made element that is a byproduct of running a nuclear reactor. Plutonium made in a reactor cannot be used in a gun-type design; because of unavoidable impurities in the fuel, it will pre-detonate in a very messy and not-very-explosive way if you try. They figured this out only in the summer of 1944, and so quickly rearranged their whole bomb-design effort around exploring a design that would work with plutonium: implosion. In the implosion design, you take a solid ball of plutonium metal (the pit) and you compress it on all sides with specially-shaped explosives that will, in a nanosecond or so, effectively reduce its volume (and thus increase its density) by a factor of about two and a half. This is incredibly difficult to accomplish with perfecting timing and symmetry: if one part of your compressive force fails to reach to pit at the same time as the other parts, the pit will just "squirt" out in the direction of the lacking force.
Nearly every aspect of the implosion design was brand-new engineering. They had to invent entirely new kinds of circuits for triggering the explosives with the required (nanosecond-level) simultaneity, and had to do some extraordinarily complex mathematics for the time (on very primitive calculation machines) in order to account for the three-dimensional interactions of the blast waves that were formed by the high explosives. They had to get new data on how many types of metals and materials even would behave under pressures as high as they were creating; they were creating conditions very different from what they were familiar with.
And worst of all, there was no easy way to tell if they had done it right without a full test. They could set off experimental high explosives without any plutonium inside, of course. But they couldn't tell if the simultaneous compression was occurring correctly, in three dimensions. They explored a lot of clever scientific to try and give them that information, but ultimately there remained large uncertainties. How much compression would occur? How much simultaneity would occur? How would the compressive force of the explosives interact with the expanding force of the nuclear reaction?
The variance in possibilities meant that they thought in May 1945 (only a few months before the test) that the implosion design, known as Fat Man, could vary from being 700 tons of TNT equivalent, upwards to 5,000 tons of TNT equivalent. There were very real fears, even at the time of the test, that it would not work at all. (This is in comparison with the Little Boy bomb which they thought would easily be in the range of 5,000-15,000 tons of TNT equivalent.)
Knowing whether this worked or not was not merely scientific. It was also tactical. Remember the question of how many uranium bombs they could produce over time: not very many. The implosion design only used 6.2 kg of plutonium — it was much more efficient in terms of fuel. And the reactors at Hanford could produce 21 kg of plutonium per month when operating at full power. So if they could get the implosion method working, they could have 3-plus atomic bombs per month on average.
So knowing if the implosion method worked was about knowing what kind of threat they had, and what kind of approach they could take with the Japanese. If it didn't work, the atomic bomb was a "one and done" sort of weapon that would be used very rarely and sparingly. If it worked poorly, then they would have one "big" bomb every few months and much more moderate weapons afterwards. And if it worked very well (which almost nobody expected; even up to the eve of the test, they thought 5,000 tons of TNT would be the upper-limit of its likely power), then they would have a weapon that could bring a nation to its knees, with the capability of wiping out 3-4 cities per month for the foreseeable future.
The implosion test was a success more than they expected. The Trinity "Gadget" detonated with the force of 20,000 tons of TNT — several times more powerful than they had thought likely. So they knew now what kind of bomb they had, and the Little Boy bomb went from being the "big bomb" to the bomb that they would never use after Hiroshima (at Hiroshima, it detonated with 15,000 tons of TNT), and in fact there was discussion about simply not dropping it, taking its fuel, and adapting it to the more efficient implosion bomb (and thus getting 8-10 bombs out of the same fuel amount; this was abandoned for strategic/time related reasons).
So, again, testing the implosion bomb was not just about scientific understanding. There was a distinct strategic element to it as well, and they wanted to be sure what kind of capabilities they had before they announced to the world that atomic bombs were now a thing that existed. Learning that they had a real capability to produce city-destroying weapons on a regular basis greatly affected the American policymakers at Potsdam (Truman was completely elated), and changed how they interacted both with the Japanese (less willingness to compromise) and even the Russians (ditto).
Because they couldn't be sure it would work. Even though the supply of the material was extremely limited, theorising that something will work on paper doesn't necessarily mean it will work in practice. Additionally, the method utilised to create the fission reaction, the implosion method, was highly complicated and experimental. different explosions from different explosives had to be precisely timed in order to produce a compressive wave that in turn compressed the density of the plutonium. The science behind the implosion method is largely beyond me but I do understand that the process to create a fission reaction has to be incredibly precise. The physicists working on The Gadget could replicate the implosion method and test the precise detonation of the explosives that would surround the plutonium without actually using the plutonium but without testing the weapon with all of its parts, there was no way of knowing if the theoretical could become practical. General Groves did have reservations about the testing of the device. He was concerned that a failed test would result in the loss of the plutonium and actually requested that the test be done in such a way as to make it possible to recover the plutonium if the test failed. Oppenheimer convinced Groves that a full test was necessary.
It is also worth considering what would have happened had the bomb been dropped and it failed to detonate. Not only did it represent an investment in the hundreds of millions of dollars, but it was also top secret. An unexploded bomb would undoubtedly be recovered by the Japanese and while the Japanese were in no shape to replicate the device, the loss of a top secret weapon to an enemy would have been unacceptable.